ShatGPT is a Discord bot powered by OpenAI's GPT models, designed to provide a unique and entertaining interaction experience for users. The bot features a grumpy personality and offers various functionalities including study room management and question answering.
- Personalized AI Responses: Utilizes OpenAI's GPT models to generate responses with a customizable personality.
- Study Room Management: Create, list, and remove study rooms within a Discord server.
- User Interaction: Responds to various commands including greetings and question answering.
- Database Integration: Uses SQLite to store information about study rooms, users, and bot preferences.
[Placeholder: Add instructions for setting up the Discord server, including creating necessary categories, setting permissions, and any other preparations required before adding the bot.]
!hello
: Greets the user.!ask [question]
: Asks ShatGPT a question.!primedirective
: Displays the bot's current personality setting.!set_personality
: (Admin only) Updates the bot's personality.
ShatGPT offers a comprehensive study room management system:
-
!sr <room_name>
: Creates a new study room.- Example:
!sr calculus
creates a room named #calculus under the //STUDYROOMS category. - Limited to 4 rooms per user.
- Room names are automatically formatted (lowercase, spaces replaced with hyphens).
- Example:
-
!lr
: Lists all existing study rooms. -
!rc <room_name>
: Removes a specified study room.- Only the creator or an admin can remove a room.
-
Create a room:
User: !sr Advanced Physics Bot: Created study room #advanced-physics. You have 3 rooms left.
-
List rooms:
User: !lr Bot: Current study rooms: - #advanced-physics (created by @User1) - #machine-learning (created by @User2)
-
Remove a room:
User: !rc advanced-physics Bot: Study room #advanced-physics has been removed.
Study rooms appear as text channels under the //STUDYROOMS category, allowing focused discussions on specific topics.
-
Clone the repository.
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
DISCORD_TOKEN
: Your Discord bot tokenOPENROUTER_API_KEY
: Your OpenAI API keyOPENAI_BASE_URL
: The base URL for OpenAI API
-
Run the bot:
python main.py
The project includes a Dockerfile for containerization. To build and run the Docker image:
docker build -t shatgpt .
docker run shatgpt
The project includes a GitHub Actions workflow for automatic deployment to Docker Hub. Ensure you have set the following secrets in your GitHub repository:
DOCKER_USERNAME
: Your Docker Hub usernameDOCKER_PASSWORD
: Your Docker Hub password
The bot uses SQLite for data persistence. The database file shatgpt.db
will be created automatically when the bot runs.
Contributions are welcome! Please feel free to submit a Pull Request.
[Insert your chosen license here]