- Project description
- Screenshots
- Deployment
- Environment variables
- Commands
- Additional features
- Room for improvement
- Contact
- Author
- License
Have you ever wanted to get mentioned on Discord at a certain time? Maybe you even wanted to see a small note from your past self in there? That's what this code was written for! (A small project made for my discord server as a fun way to learn MongoDB.)
To self-host this project for free:
- Create a new application on https://discord.com/developers/applications.
- Create a new bot in the application.
- Add the bot to a server and get the bot's token and the server's target bot channel's ID.
- Create a free cluster on https://www.mongodb.com/ and get its log in link and password. Customize the link to the format given below.
- Create a database and three collections inside it. First one is for future reminders, second one is for past reminders, third one is for user profiles.
- Create a project on https://replit.com and connect it with your fork of this repository (or manually copy the files there).
- Create replit environment variables described below and fill them with your values.
- Run the code on replit and copy the link of the created website.
- Create a new monitor on https://uptimerobot.com/ on the link of your aforementioned website. Keep the other parameters at default values.
π Done! The bot is ready to use. π
Feel free to contact me if you have any questions π
To run this project, you have to set up the following environment variables (the values below are exemplary).
DATABASE_NAME=MONGO_BOT_DATABASE_NAME
PAST_REMINDERS_COLLECTION_NAME=PAST_REMINDERS
FUTURE_REMINDERS_COLLECTION_NAME=FUTURE_REMINDERS
REMINDERBOT_USERS_PROFILES_COLLECTION_NAME=USERS_PROFILES
MONGODB_LINK=mongodb+srv://myusername:{}@myusername.bl5bla.mongodb.net/test
PW=TESTPW
TOKEN=this_is_a_test_token_as21d4f1vSWZXSzvErY12314LoNG4S12TokEn1sdaf2304fd
CHANNEL_ID=65735462653125342
LOCAL_TIMEZONE=US/Eastern
!remind me of X on 05.07.22 12:00
- Creates a reminder on a certain point in the future
!remind me of X in 15 mins
- Creates a reminder after some time interval from the present
!list_reminders
- Lists 10 upcoming reminders of everyone
!my_reminders
- Lists 10 upcoming reminders of yours
!show_reminder <ID>
- Shows the details of a reminder
!delete_reminder <ID>
- Deletes a reminder
Besides the commands behaviour, the bot also:
- validates user's profile (puts the user on a cooldown if needed),
- validates message content,
- validates date and time of a reminder.
- Automated live tests (dedicated bot for testing this one),
- some functions should be refactored into several new ones,
- generating a jpg of the incoming week with your reminders on it,
- interval reminders,
- parsing different formats of dates (dateutil.parser),
- reminding flashcards using the Leitner system,
- command for deleting all your reminders,
- add cooldown on all commands, not only on creating reminders,
- mentioning other users in advance.
MIT