9e221709ac
chore: remove error handling blocks from dev.py to simplify code and rely on global error handling refactor: remove dollar sign from usage instructions in command decorators for clarity and consistency across all command usage instructions feat(error.py): add prefix to command usage in error messages for better clarity refactor(error.py): change error messages to be more descriptive and accurate feat(error.py): use embeds for error messages for better readability refactor(error.py): comment out specific error handlers to allow global handler to catch all errors for consistency refactor(help.py): remove static prefix and add dynamic prefix fetching to improve flexibility feat(help.py): add command aliases to help command categories for better command visibility refactor(help.py): change several methods to async to support dynamic prefix fetching feat(embeds.py): add create_error_embed method to standardize error embed creation |
||
---|---|---|
.archive | ||
.github | ||
assets | ||
config | ||
docs | ||
prisma | ||
tux | ||
.editorconfig | ||
.env.example | ||
.gitignore | ||
.mise.toml | ||
.pre-commit-config.yaml | ||
docker-compose.yml | ||
Dockerfile | ||
justfile | ||
LICENSE.md | ||
mkdocs.yml | ||
poetry.lock | ||
poetry.toml | ||
pyproject.toml | ||
README.md | ||
renovate.json |
Tux
A Discord bot for the All Things Linux Discord server
NOTE: This bot (without plenty of tweaking) is not ready for multi-server use, we recommend against using it until it is more complete
About
Tux is a Discord bot for the All Things Linux Discord server. It is designed to provide a variety of features to the server, including moderation, support, utility, and various fun commands. The bot is written in Python using the discord.py library.
Tech Stack
- Poetry for dependency management
- Docker and Docker Compose for development and deployment
- Strict typing with Pyright and type hints
- Type safe ORM using Prisma
- PostgreSQL database with Supabase
- Linting and formatting via Ruff and Pre-commit
- Justfile for easy CLI commands
- Beautiful logging with Loguru
- Exception handling with Sentry
Bot Features
- Asynchronous codebase
- Hybrid command system with both slash commands and traditional commands
- Cog loading system with hot reloading
- Branded embeds and messages
- Robust error handling
- Activity rotation
- Custom help command
- Configuration system
- Dynamic role-based (access level) permission system
Installation
Prerequisites
- Python 3.12
- Poetry
- Optional: Docker if you want to run the bot in a container.
- Optional: Docker Compose if you want to define the container environment in a
docker-compose.yml
file. - Optional: Just if you want to use the Justfile for easy CLI commands.
Steps
-
Clone the repository
git clone https://github.com/allthingslinux/tux && cd tux
-
Install the dependencies
poetry install
-
Activate the virtual environment
poetry shell
-
Install the pre-commit hooks
pre-commit install
-
Generate the prisma client
prisma generate
-
Copy the
.env.example
file to.env
and fill in the required valuescp .env.example .env
-
Copy the
config/settings.json.example
file toconfig/settings.json
and fill in the required valuescp config/settings.json.example config/settings.json
-
Run the bot
poetry run python tux/main.py
-
Run the sync command in the server to sync the slash command tree.
{prefix}dev sync <server id>
Development Notes
Note
Make sure to add your discord ID to the sys admin list if you are testing locally.
Note
Make sure to set the prisma schema database ENV variable to the DEV database URL.
License
This project is licensed under the terms of the The GNU General Public License v3.0. See the LICENSE file for details.