A Discord bot for automating outreach emails with resume attachment, role inference, and MongoDB tracking. The bot interacts with users via Discord commands, generates tailored email content, and sends emails with the appropriate resume attached.
- Discord Integration: Interact with the bot using commands (
!email,!confirm,!cancel,!update,!hello). - Automated Email Generation: Generates personalized outreach emails based on user input and inferred job role.
- Resume Attachment: Automatically selects and attaches the correct resume (software or data science) based on the inferred role.
- Role Inference: Uses keyword scoring to determine if the message is for a software or data science/machine learning role.
- MongoDB Tracking: Tracks the number of emails sent by each user.
- Robust Error Handling: Handles invalid input, missing environment variables, and database errors gracefully.
- Email Preview and Editing: Allows users to preview, confirm, update, or cancel emails before sending.
git clone https://github.com/deepakbhagatiitr/DiscordBot.git
cd DiscordBotpip install -r requirements.txtCreate a .env file in the root directory and set the following variables:
DISCORD_TOKENNew=your_discord_bot_token
[email protected]
SMTP_PASSWORD=your_gmail_app_password
MONGODB_URI=your_mongodb_connection_string
DISCORD_TOKENNew: Your Discord bot token.SMTP_EMAIL: Gmail address used to send emails.SMTP_PASSWORD: Gmail app password (not your main password).MONGODB_URI: MongoDB connection string (e.g., from MongoDB Atlas).
Place your resumes in the resumes/ directory:
resumes/software_dev_resume.pdfresumes/data_science_resume.pdf
-
Start the Bot:
python main.py
-
Discord Commands:
!hello— Check if the bot is running.!email— Start the email sending process.- Paste your message as instructed (the bot will guide you).
!confirm— Confirm and send the email.!cancel— Cancel the pending email.!update— Edit the email before sending.
-
Email Format:
- The bot will extract recipient, subject, and message from your input.
- Example:
to:[email protected] subject:Application for ML Role message:Hello, I am interested in...
DiscordBot/
├── main.py # Main Discord bot logic
├── emailsend.py # Email sending utility
├── linkedin_outreach_email_generator.py # Email content generator
├── requirements.txt # Python dependencies
├── resumes/
│ ├── software_dev_resume.pdf
│ └── data_science_resume.pdf
└── .env # Environment variables (not committed)
- discord.py
- pymongo
- python-dotenv
Install all dependencies with:
pip install -r requirements.txt- Make sure to enable "Less secure app access" or use an App Password for Gmail SMTP.
- The bot uses MongoDB to track user activity; ensure your database is accessible.
- Only one pending email per user is tracked at a time.
For questions or support, open an issue or contact