[go: up one dir, main page]

Skip to content

gg2001/EmailBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmailBot allows you to verify that your Discord server members have an email address with a specific domain.

Discord License

Invite: https://discord.com/api/oauth2/authorize?client_id=731027450607435846&permissions=268503040&scope=bot

Discord server: https://discord.gg/MfFMxu9

IMPORTANT: The bot you invite via the link above has a 100 email per day limit since I am using the free version of the Sendgrid API. Due to a recent influx of new users this limit has been getting hit quite often. If this limit is reached the bot will reply "Please send your email again in a few hours. The bot has hit its 100 email per day limit." If the limit is annoying, consider hosting the bot yourself. The other option is to tip me some crypto to cover the $15 per month Sendgrid plan, and I'll upgrade my account so it doesn't hit the limits (BTC: bc1q6w82amhdzp3hqe803cncdlnarvfd9es8xl0dpw, ETH: 0xF3ff2D5910C27192857b7DFBcf3Cf9678b89BfA0).

Usage

After inviting the bot to your server, a domain must be added using .dominadd domain. .vstatus is the help command:

User commands: 
   .verify -> Sends a DM to the user to verify their email
   .vstatus -> This help message

Admin commands: 
 - A domain must be added before users can be verified.
 - Use .rolechange instead of server settings to change the name of the verified role.
   .enableonjoin -> Enables verifying users on join
   .disableonjoin -> Disables verifying users on join
   .domainadd domain -> Adds an email domain
   .domainremove domain -> Removes an email domain
   .rolechange role -> Changes the name of the verified role

Domains: 
Verify when a user joins? (default=False): False
Verified role (default=Verified): Verified

Example

Let's say you want a Discord server just for people who have a @randomuniversity.edu email address. Add this bot to your server and when someone joins, they will get a DM asking for their @randomuniversity.edu email address. The bot then emails them a verification code. If they reply with the correct code, they get the "Verified" role.

Installation

Install the dependencies:

pip install -r requirements.txt

Before running it make sure these environment variables are set. You will need a Sendgrid and Discord account (both are free):

export SENDGRID_API_KEY='YOUR_SENDGRID_API_KEY'
export SENDGRID_EMAIL='YOUR_SENDGRID_EMAIL'
export DISCORD_TOKEN='YOUR_DISCORD_TOKEN'

Run the bot with:

python bot.py

Task list

  • Separate bot commands/events into cogs and put sqlite commands in a separate file
  • Make the flask server and scheduled sqlite backups optional
  • Allow roles with spaces to be added
  • Make the feature that allows users who leave to retain their Verified role when they join back, optional for the server admin
  • Add a .unverify member command
  • Use Role.id instead of Role.name

License

EmailBot is licensed under GNU GPL v3.

About

Discord bot for verifying the email domain of server members

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages