This bot is designed to manage and track challenges for users in a Discord server. It uses SQLite for data storage.
The bot provides the following commands:
-
!add_challenge [challenge] [points]
: Adds a new challenge if it doesn't already exist. You can add multiple challenges at once by separating them with commas. Example:!add_challenge challenge name 10
. Another example:!add_challenge challenge1, challenge2, challenge3 10
. -
!all_challenges
: Lists all challenges in the database. -
!user_stats [user]
: Retrieves statistics for a user. -
!random_challenge [user]
: Selects a random challenge for a user. -
!complete [challenge name]
: Marks a challenge as completed for a user. -
!leaderboard
: Displays the leaderboard of all users. -
!remaining [user]
: Shows the remaining challenges for a user. -
!search [keyword]
: Search for challenges. -
!delete_challenge [challenge]
: Delete a challenge. Example:!delete_challenge [challenge name]
. -
!help
: Display the list of commands.
To use this bot, you need to have Python installed. If you don't have Python installed, you can download it from the official website.
-
Clone this repository to your local machine.
-
Install the required dependencies. The bot requires the following libraries, which you can install with pip:
pip install discord.py
pip install python-dotenv
pip install fuzzywuzzy
pip install python-Levenshtein
pip install discord-py-slash-command #not really needed, mainly used for testing purposes. If any errors occur without this, be sure to install it.
-
Create a new bot on the Discord developer portal and get your bot token.
-
Replace
TOKEN
in thebot.run(TOKEN)
line at the end of the bot.py file with your bot token. -
Run the bot.py file:
python bot.py
The bot should now be running and ready to join a server!
To use the bot commands, type the command name preceded by an exclamation mark in a text channel where the bot has permission to read and send messages. For example, to add a new challenge:
!add_challenge "Challenge Name" 50
!user_stats @user
!complete Challenge Name
!progress @user1 @user2
!remaining @user
!search Run
!delete_challenge Challenge 1
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the terms of the MIT license.