A modular Discord bot with various commands and features.
├── bot.py # Main entry point
├── config.py # Configuration settings
├── utils.py # Utility functions
├── ui.py # Discord UI components
├── requirements.txt # Python dependencies
├── launch.sh # Launch script
├── disco.service # Systemd service file
└── cogs/ # Command modules
├── api_commands.py # API-related commands
├── basic_commands.py # Basic bot commands
└── user_commands.py # User-related commands
- Create a
.envfile in the project root with:
DISCORD_TOKEN=your_bot_token
GUILD_ID=your_guild_id
GENERAL_CHANNEL_ID=your_channel_id
WEATHER_API_KEY=your_weather_api_key
- Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh- Run the bot:
uv run bot.py/hello: Says hello/add: Adds two numbers/send: Sends text to the channel/color: Shows color selection dropdown/joined: Shows when a member joined/midnight: Shows time until midnight/best_language: Shows the best programming language
/quote: Shows a random quote/weather: Shows weather for a specified city- Context menu
Translate: Translates a message from French to English
- Context menu
Show Message Count: Shows how many messages a user has sent
To run as a system service:
- Edit
disco.serviceto point to the correct directories - Copy to systemd:
sudo cp disco.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable disco.service
sudo systemctl start disco.serviceTo restart the service:
sudo systemctl restart disco.serviceTo add new commands, create a new Python file in the cogs directory following the pattern of existing cogs, then restart the bot.