Seneca-Software-Developers-Club / LeetBot

A Discord bot for the SSDC server that sends a Leetcode problem to a particular channel everyday.
MIT License
0 stars 1 forks source link

Multi-server Support and Database Management #4

Open mush1e opened 1 month ago

mush1e commented 1 month ago

Description

Currently, the bot only supports a single database instance (leetbot.db), which limits its usability across multiple Discord servers (guilds). This setup is not scalable and doesn't allow for separate leaderboards or data per guild.

Proposed Changes

  1. Multi-server Database Management:

    • Implement a system to create and manage separate SQLite databases for each Discord guild (guild_id_leetbot.db). Modify database initialization (init_db(guild_id)) to dynamically create and manage guild-specific databases.
  2. Channel ID Assignment:

    • Allow assignment of a specific channel ID for each guild where daily LeetCode problems are posted. Modify the bot to use the assigned channel ID for scheduled daily postings.
  3. Dump Directory for Databases:

    • Create a dump directory within the project structure to store all guild-specific .db files. Ensure the bot can read from and write to this directory securely.

Tasks

Additional Information

mush1e commented 1 month ago

Could I be assigned to this?