Skip to content

BSski/discord-reminder-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Demo Screenshot

Discord Reminder Bot

Demo Uptime CodeFactor Maintainability Code style: black

Table of contents

πŸ“œ Project description

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.)

πŸ“· Screenshots

Commands Screenshot

πŸ› οΈ Deployment

To self-host this project for free:

  1. Create a new application on https://discord.com/developers/applications.
  2. Create a new bot in the application.
  3. Add the bot to a server and get the bot's token and the server's target bot channel's ID.
  4. 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.
  5. 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.
  6. Create a project on https://replit.com and connect it with your fork of this repository (or manually copy the files there).
  7. Create replit environment variables described below and fill them with your values.
  8. Run the code on replit and copy the link of the created website.
  9. 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 πŸ™‚

πŸ” Environment variables

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

❗ Commands

!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

πŸš€ Additional features

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.

⬆️ Room for improvement

  • 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.

πŸ“ž Contact

πŸ‘· Author

πŸ”“ License

MIT

Releases

No releases published

Packages

No packages published

Languages