This is a Discord bot that provides member authentication in a server using email address and OTP.
To install the bot, follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies by running
npm install
in the project directory. - Create a new bot application on the Discord Developer Portal and obtain the bot token.
- Invite the bot to your Discord server by going to the OAuth2 page in the developer portal, selecting the "bot" scope, and generating an invite link.
- Update the
BOT_TOKEN
variable in thebot.js
file with your bot token. - Update the
email
andpassword
variables in thebot.js
file with the email address and password you want to use to send OTPs. - Start the bot by running
npm start
in the project directory.
To use the bot, follow these steps:
- In a channel on your server, type
!auth
to initiate the authentication process. - The bot will prompt you to enter your email address. Enter your email address in the channel.
- The bot will send an OTP code to your email address and display a QR code in the channel.
- Scan the QR code with your authenticator app and enter the OTP code in the channel in the following format:
!verify <code>
. - If the OTP code is valid, the bot will give you the "member" role on the server.
This bot uses the following dependencies:
discord.js
- a Node.js module for interacting with the Discord APInodemailer
- a Node.js module for sending emailspeakeasy
- a Node.js module for generating and verifying OTPsqrcode
- a Node.js module for generating QR codes
This project is licensed under the MIT License. See the LICENSE
file for details.