https://github.com/lkaesberg/emailverify
Discord bot to verify your email
https://github.com/lkaesberg/emailverify
bot discord discord-bot discord-js email nodejs nodemailer npm sqlite3
Last synced: 26 days ago
JSON representation
Discord bot to verify your email
- Host: GitHub
- URL: https://github.com/lkaesberg/emailverify
- Owner: lkaesberg
- License: gpl-3.0
- Created: 2021-10-06T16:07:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-05-02T12:06:16.000Z (about 2 months ago)
- Last Synced: 2026-05-02T14:11:46.171Z (about 2 months ago)
- Topics: bot, discord, discord-bot, discord-js, email, nodejs, nodemailer, npm, sqlite3
- Language: JavaScript
- Homepage: https://emailbot.larskaesberg.de
- Size: 9.24 MB
- Stars: 56
- Watchers: 1
- Forks: 28
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
Discord Email Verify
A powerful Email Verification Bot for Discord servers
๐ Website
---
๐ Table of Contents
---
## ๐ About
This bot verifies that a Discord user owns an email address with a specific domain (e.g., verify `name@university.edu` emails). This is useful for servers that need to restrict access to verified members only, such as:
- **University/College servers** - Verify students with `.edu` emails
- **Company servers** - Verify employees with corporate emails
- **Organization servers** - Verify members with organization emails
### How it works:
1. User clicks a verification button
2. Bot sends a DM asking for their email address
3. A verification code is sent to the email
4. User enters the code to receive the verified role
---
## ๐ Usage
### Invite the Bot
Use this link to invite the bot to your server:
[](https://discord.com/api/oauth2/authorize?client_id=895056197789564969&permissions=268504128&scope=bot%20applications.commands)
### Quick Setup
1. **Invite the bot** using the link above
2. **Add a default role**: `/role add @Verified` (given to all verified users)
3. **Add allowed domains**: `/domain add @university.edu` (use `@*.edu` for all .edu domains)
4. **Create a verification button**: `/button #verification-channel "Click to Verify"`
5. Done! Users can now verify themselves
### Advanced: Domain-Specific Roles
You can assign different roles based on which email domain the user verifies with:
```
/domainrole add domain:@staff.company.com role:@Staff
/domainrole add domain:@*.edu role:@Student
```
Users will receive their domain-specific roles **plus** any default roles you've configured.
---
## ๐ Commands
### ๐ค User Commands
| Command | Description |
|---------|-------------|
| `/verify` | Start the email verification process |
| `/data delete-user` | Delete your verification data and remove verified status |
### ๐ฅ Role Configuration
| Command | Description |
|---------|-------------|
| `/role add ` | Add a default role given to all verified users |
| `/role remove ` | Remove a role from the default roles list |
| `/role list` | View all default roles |
| `/role unverified [role]` | Set or view the optional role for unverified members |
### ๐ญ Domain-Specific Roles
Assign different roles based on email domain:
| Command | Description |
|---------|-------------|
| `/domainrole add ` | Add a role for a specific email domain |
| `/domainrole remove ` | Remove a role from a domain |
| `/domainrole list` | View all domain-role mappings |
| `/domainrole clear ` | Remove all roles for a domain |
> ๐ก **Example:** `/domainrole add @*.edu @Student` gives the Student role to anyone with a .edu email
### ๐ง Domain Management
| Command | Description |
|---------|-------------|
| `/domain add ` | Add allowed email domains (supports `*` wildcard) |
| `/domain remove ` | Remove allowed domains |
| `/domain list` | View all allowed domains |
| `/domain clear` | Remove all allowed domains |
> ๐ก **Wildcard Example:** Use `@*.edu` to allow any `.edu` email address
### ๐ซ Blacklist Management
| Command | Description |
|---------|-------------|
| `/blacklist add ` | Block email patterns (supports `*` wildcard) |
| `/blacklist remove ` | Unblock patterns |
| `/blacklist list` | View all blacklisted entries |
| `/blacklist clear` | Remove all blacklist entries |
> ๐ก **Wildcard Examples:** `*@tempmail.*` blocks all tempmail domains, `*spam*` blocks emails containing "spam"
### โ๏ธ Settings
| Command | Description |
|---------|-------------|
| `/settings language ` | Change the bot's language |
| `/settings log-channel [channel]` | Set or disable the verification log channel |
| `/settings verify-message [message]` | Set or reset custom message in verification emails |
| `/settings auto-verify ` | Auto-prompt new members to verify on join |
| `/settings auto-unverified ` | Auto-assign unverified role to new members |
### ๐ก๏ธ Moderation & Setup
| Command | Description |
|---------|-------------|
| `/button ` | Create a verification button embed in a channel |
| `/manualverify ` | Manually verify a user without email confirmation |
| `/set_error_notify` | Configure where error notifications are sent |
### ๐ Information
| Command | Description |
|---------|-------------|
| `/status` | View bot configuration, statistics, and check for issues |
| `/help` | Show setup instructions and command overview |
### โ ๏ธ Data Management
| Command | Description |
|---------|-------------|
| `/data delete-user` | Delete your personal verification data |
| `/data delete-server` | Delete all server data and remove the bot |
> โ ๏ธ **Note:** Most commands require administrator permissions
### Important: Role Hierarchy
The EmailBot role **must be higher** in the role hierarchy than the verified and unverified roles, otherwise you'll get a `Can't find roles. Please contact the admin!` error.
---
## ๐ณ Self Hosting
If you want to self-host the bot, you have two options: **Docker** (recommended) or **Manual Installation**.
> ๐ **Enjoying the bot?** If you find this project useful, please consider [buying me a pizza](https://www.buymeacoffee.com/sral12486) to support ongoing development!
### Docker (Recommended)
The easiest way to self-host is using Docker with the pre-built image.
#### 1. Create a directory for the bot
```bash
mkdir emailverify && cd emailverify
```
#### 2. Create the config file
```bash
mkdir config
nano config/config.json
```
Add your configuration:
```json
{
"token": "",
"clientId": "",
"email": "",
"username": "",
"password": "",
"smtpHost": "",
"isGoogle": false
}
```
#### 3. Create docker-compose.yml
```yaml
version: '3'
services:
emailverify:
image: ghcr.io/lkaesberg/emailverify:latest
ports:
- 8181:8181
volumes:
- ./config:/usr/app/config
restart: always
```
#### 4. Start the bot
```bash
docker-compose up -d
```
#### Docker CLI Alternative
```bash
docker run -d \
--name emailverify \
-p 8181:8181 \
-v $(pwd)/config:/usr/app/config \
--restart always \
ghcr.io/lkaesberg/emailverify:latest
```
---
### Manual Installation
**Requirements:** Node.js v16.15.0 or higher
#### 1. Clone the repository
```bash
git clone https://github.com/lkaesberg/EmailVerify.git
cd EmailVerify
```
#### 2. Create the config file
```bash
nano config/config.json
```
```json
{
"token": "",
"clientId": "",
"email": "",
"username": "",
"password": "",
"smtpHost": "",
"isGoogle": false
}
```
#### 3. Install dependencies and start
```bash
npm install
npm start
```
---
### Configuration Options
| Option | Description |
|--------|-------------|
| `token` | Your Discord Bot Token from the [Discord Developer Portal](https://discord.com/developers/applications) |
| `clientId` | Your Discord Bot's Client ID |
| `email` | The email address that will send verification codes |
| `username` | SMTP server username (usually your email address) |
| `password` | SMTP server password or App Password |
| `smtpHost` | Your SMTP server (e.g., `smtp.gmail.com`) |
| `isGoogle` | Set to `true` if using Gmail |
| `topggToken` | *(Optional)* Your Top.gg API token |
> ๐ก **Gmail Users:** You need to create an [App Password](https://support.google.com/accounts/answer/185833) and use that instead of your regular password.
### Debugging
Type `email` in the console to see debugging messages for email errors.
---
## ๐ฅ Contributors
### Developer
- **Lars Kaesberg** - [GitHub](https://github.com/lkaesberg)
### Translators
| Language | Contributor |
|----------|-------------|
| ๐ฌ๐ง English | Lars Kaesberg |
| ๐ฉ๐ช German | Lars Kaesberg |
| ๐ช๐ธ Spanish | gus2131 |
| ๐ต๐ฑ Polish | kploskonka |
| ๐ฎ๐ฑ Hebrew | Norma1Name |
| ๐ฐ๐ท Korean | iplayagain |
| ๐ซ๐ท French | Charles Van |
| ๐น๐ท Turkish | EmreSoftware |
### Want to add a new language?
Create an issue with your translation file using the [English template](language/english.json) as a reference.
---
## ๐ Support the Project
If you're self-hosting this bot and find it useful, please consider supporting the development! Your contribution helps keep the project maintained and improved.

---
Made with โค๏ธ by Lars Kaesberg
