Nana2929 / discord-daily-task-bot

Side project: discord bot for daily-task reminders

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🤖 Discord Daily Task Bot

🤖 Invitation Link

  • Note that you have to be the server owner or have the permission to add bots to the server.
  • The bot is set to have permission 8 (admin).
  • The bot is not set up on a permanent server, so it might be offline sometimes or slow to respond if the server is busy.

I. Story & Purpose

The leetcode-challenge-bot once served the Discord Server 🥘 Leetcode 涮涮鍋 loyally to remind the members of the server to do the daily leetcode challenge, now it is torn down because the hosted server provider starts charging fees. Moreover, We have been thinking of creating a more general bot that can remind the members of the server to do their daily tasks with more interactive features, hence the 🤖 Daily Task Bot was born.

II. Language

The bot's commands are written mainly in Chinese.

The bot is developing under Python 3.8.16.

III. Features

Apart from the basic features already provided in the template, 🤖 Daily Task Bot has the following features:

i. !register

In order for our Daily Task Bot to remind you on a daily basis, it has to first know your time zone. This command's main purpose is to allow you to register your time zone to facilitate the commands listed in !daily.

ii. !daily 每日任務管理小幫手

>> !daily
    - add      # ✅
    - listall  # ✅
    - listmine # ✅
    - delete   # ✅
    - done        # ✅
    - listdone   # ✅
    - subscribe   # ✅
    - unsubscribe # ✅
  1. add and delete: To add a daily task, you can use !daily add to add the task to the database. The bot will then ask you to enter the task name, the task description and the relevant url. You can only !daily delete the tasks you created.
  2. listalland listmine: listall lists all the tasks in the database; listmine lists all the tasks that you've created.

  1. done adds a check mark ✅ in the task that you've done today. Similar to !daily in leetcode-challenge-bot.listdone -n lists all the tasks that you've done recently. -n is the number of days you want to list. For example, !daily listdone -3 will list the recent 3 tasks that you've done. Not specifying -n will list all the tasks that you've done.

  1. subscribe and unsubscribe: To subscribe to the daily task reminder for a particular daily task. The bot will send you a reminder at the reminding time given your registered timezone. To unsubscribe from the daily task reminder for a particular daily task, provided that you've subscribed to it.

iii. !words 增加鼓勵/譴責字彙

>> !words
    - add      # ✅
    - delete   # ✅
    - list     # ✅
    - listmine # ✅

The !words command is used to add, delete and list the words that you would like to see when being reminded or condemned by 🤖 Daily Task Bot. The words are stored in the database and will be randomly selected when being reminded or condemned. The leetcode-challenge-bot has similar features but it does not exposed the API to add, delete and list the words.

iv. !doggo 療癒狗狗

!doggo command will send a random dog picture to the channel from the API Dog CEO. You can add a {breed} command after !doggo to get a random dog picture of the breed you specified. For example, !doggo shiba will send a random shiba picture. For breed name that has spaces in between, simply !doggo golden retriever will do the trick.

IV. Implementation Details

  • ⛏ tech spec
  • 🗺 database schema
  • ervices:
    • Database: PostgreSQL; docker image (postgis/postgis:13-master)
    • Database Management CMS: Directus; docker image (directus/directus:latest)
    • Directus's Cache: Redis; docker image(redis:6
  • Making sure your port is not occupied (the ports could be changed in docker-compose.yaml); then use docker-compose up -d to start the services.
  • After a successful docker compose up, Go to localhost:{your_port} to access the Directus CMS, for example: localhost:8056.

V.TODO & Future Works

  • !daily delete 要檢查該任務是否有其他 subscribers,如果有的話則不可以刪除,並跳出警告訊息。
  • !daily subscribe 譴責和提醒只在當日該任務尚未完成時才啟動。

VI. Thanks

We would like to thank them for their contributions to the open-source community.

About

Side project: discord bot for daily-task reminders

License:Apache License 2.0


Languages

Language:Python 100.0%