The StudyTime Discord Bot is an application developed for Discord with the aim of facilitating task management and providing alerts to assist in study routines.
-
User Registration
- /register Register user. Used to gather server's ID, user's ID and channel's ID.
-
Task Management
- /create_task: Creates a new task.
- /tasks: Lists all tasks. For each task there are buttons to Edit and Delete task.
-
Note Management
- /create_note: Creates a new note.
- /notes: Lists all notes. For each task there are buttons to Edit and Delete note.
-
Chat with ChatGPT
- /chat: Initiates a conversation with ChatGPT to get answers to your questions or start a conversation.
-
Alerts
- Alerts are automatically sent at scheduled times for each task.
-
Help
- /help Contains all commands.
-
/set_channel Set preferred channel for bot messages.
-
**.sync ** Syncs all commands to a new server (credit to AbstractUmbra: https://about.abstractumbra.dev/discord.py/2023/01/29/sync-command-example.html)
-
Clone the Repository:
git clone https://github.com/f-andrei/StudyTime.git
-
Install Requirements: Navigate to the project directory and install the required Python packages using pip:
cd StudyTime pip install -r requirements.txt
-
Set Up OpenAI API Key:
-
Visit OpenAI's Quickstart Guide to obtain your API key.
-
Set up your API key as an environment variable. You can do this by adding the following line to your
.env
file in the project directory:OPENAI_API_KEY=your_api_key_here
-
-
Set Up Environment Variables:
-
Create a
.env
file in the project directory if it doesn't already exist. -
Define the necessary environment variables in the
.env
file. For example:DISCORD_TOKEN=your_discord_bot_token_here
-
Refer to the Discord Developer Portal to learn how to obtain your Discord bot token.
-
-
Run the Bot: Start the bot by running the main Python script:
python main.py
-
Set up Studytime database API:
- Access the API repository and follow the installation guide: studytime-db-api
-
Invite the Bot to Your Discord Server:
-
Visit the Discord Developer Portal and create a new application.
-
Add a bot to your application and copy the bot token.
-
Use the bot token to invite the bot to your Discord server using the following link (replace
<YOUR_BOT_CLIENT_ID>
with your bot's client ID):https://discord.com/oauth2/authorize?client_id=<YOUR_BOT_CLIENT_ID>&scope=bot
-
-
Enjoy Using the StudyTime Discord Bot! You can now use the bot's commands and features on your Discord server.