2024-04-11 19:31:02 +00:00
< div align = "center" >
< img src = "docs/resources/tux.gif" width = 128 height = 128 > < / img >
< h1 > Tux< / h1 >
< h3 > < b > A Discord bot for the All Things Linux Discord server< / b > < / h3 >
< / div >
< div align = "center" >
< p align = "center" >
< a href = "https://github.com/allthingslinux/tux/forks" >
< img alt = "Forks" src = "https://img.shields.io/github/commit-activity/m/allthingslinux/tux?style=for-the-badge&logo=git&color=EBA0AC&logoColor=EBA0AC&labelColor=302D41" > < / a >
< a href = "https://github.com/allthingslinux/tux" >
< img alt = "Repo size" src = "https://img.shields.io/github/repo-size/allthingslinux/tux?style=for-the-badge&logo=github&color=FAB387&logoColor=FAB387&labelColor=302D41" / > < / a >
< a href = "https://github.com/allthingslinux/tux/issues" >
< img alt = "Issues" src = "https://img.shields.io/github/issues/allthingslinux/tux?style=for-the-badge&logo=githubactions&color=F9E2AF&logoColor=F9E2AF&labelColor=302D41" > < / a >
2024-06-22 04:07:05 +00:00
< a href = "https://www.gnu.org/licenses/gpl-3.0.html" >
2024-04-11 19:31:02 +00:00
< img alt = "License" src = "https://img.shields.io/github/license/allthingslinux/tux?style=for-the-badge&logo=gitbook&color=A6E3A1&logoColor=A6E3A1&labelColor=302D41" > < / a >
< a href = "https://discord.gg/linux" >
< img alt = "Discord" src = "https://img.shields.io/discord/1172245377395728464?style=for-the-badge&logo=discord&color=B4BEFE&logoColor=B4BEFE&labelColor=302D41" > < / a >
< / p >
< / div >
2024-05-22 00:16:15 +00:00
# NOTE: This bot (without plenty of tweaking) is not ready for multi-server use, we recommend against using it until it is more complete
2024-04-11 19:31:02 +00:00
## 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.
2024-07-26 18:42:39 +00:00
## 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
2024-07-31 06:06:14 +00:00
- Dynamic role-based (access level) permission system
2024-07-26 18:42:39 +00:00
2024-04-11 19:31:02 +00:00
## Installation
### Prerequisites
2024-04-27 19:44:51 +00:00
- Python 3.12
2024-04-11 19:31:02 +00:00
- [Poetry ](https://python-poetry.org/docs/ )
2024-07-31 15:03:57 +00:00
- Optional: [Docker ](https://docs.docker.com/get-docker/ ) if you want to run the bot in a container.
- Optional: [Docker Compose ](https://docs.docker.com/compose/install/ ) if you want to define the container environment in a `docker-compose.yml` file.
- Optional: [Just ](https://github.com/casey/just/ ) if you want to use the Justfile for easy CLI commands.
2024-04-11 19:31:02 +00:00
### Steps
1. Clone the repository
```bash
git clone https://github.com/allthingslinux/tux & & cd tux
```
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
2. Install the dependencies
```bash
poetry install
```
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
3. Activate the virtual environment
```bash
poetry shell
```
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
4. Install the pre-commit hooks
```bash
pre-commit install
```
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
5. Generate the prisma client
```bash
prisma generate
```
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
6. Copy the `.env.example` file to `.env` and fill in the required values
```bash
cp .env.example .env
```
2024-07-31 18:52:13 +00:00
2024-07-29 16:45:22 +00:00
7. Copy the `config/settings.json.example` file to `config/settings.json` and fill in the required values
```bash
cp config/settings.json.example config/settings.json
```
2024-07-31 18:52:13 +00:00
2024-07-31 06:06:14 +00:00
8. Run the bot
```bash
poetry run python tux/main.py
```
2024-07-31 18:52:13 +00:00
2024-07-31 06:06:14 +00:00
9. Run the sync command in the server to sync the slash command tree.
2024-04-27 19:44:51 +00:00
```
2024-07-26 18:32:54 +00:00
{prefix}dev sync < server id >
2024-04-27 19:44:51 +00:00
```
2024-07-31 18:52:13 +00:00
## Development Notes
2024-08-01 23:31:47 +00:00
> [!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.
2024-07-31 18:52:13 +00:00
2024-04-11 19:31:02 +00:00
## License
2024-08-01 23:31:47 +00:00
2024-06-22 03:58:07 +00:00
This project is licensed under the terms of the The GNU General Public License v3.0. See the [LICENSE ](LICENSE.md ) file for details.
2024-08-01 23:27:25 +00:00
2024-08-01 23:31:47 +00:00
## Metrics
2024-08-01 23:27:25 +00:00
![Alt ](https://repobeats.axiom.co/api/embed/cd24c48127e0b6fbc9467711d6d4bd74b30ff8d2.svg "Repobeats analytics image" )