Skip to content

Commit 215b1e4

Browse files
authored
Merge branch 'main' into renovate/pyright-1.x-lockfile
2 parents 0741270 + 0370854 commit 215b1e4

25 files changed

+426
-321
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DEV_TOKEN=""
2020

2121
SENTRY_URL=""
2222

23-
PROD_COG_IGNORE_LIST=
23+
PROD_COG_IGNORE_LIST="rolecount,mail" # These are ATL specific cogs that are not needed in Tux unless you are ATL
2424
DEV_COG_IGNORE_LIST=
2525

2626
GITHUB_APP_ID=

Dockerfile

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Base stage:
22
# - Pin the Python base image for all stages
3-
# - Install only the common runtime dependencies
4-
# - git
5-
# - tealdeer
3+
# - Install only the common runtime dependencies and shared libraries
64
FROM python:3.13-slim AS base
75

86
RUN apt-get update && \
97
apt-get install -y --no-install-recommends \
108
git \
9+
libcairo2 \
10+
libgdk-pixbuf2.0-0 \
11+
libpango1.0-0 \
12+
libpangocairo-1.0-0 \
13+
shared-mime-info \
1114
tealdeer && \
1215
apt-get clean && \
1316
rm -rf /var/lib/apt/lists/* && \
@@ -21,23 +24,17 @@ ENV PYTHONUNBUFFERED=1 \
2124

2225
# Build stage:
2326
# - Install build tools (for packages with native dependencies)
27+
# - Install dev headers for packages with native dependencies
2428
# - Install poetry (for managing app's dependencies)
2529
# - Install app's main dependencies
2630
# - Install the application itself
2731
# - Generate Prisma client
2832
FROM base AS build
2933

30-
# TODO: Are these needed?
31-
# - curl
32-
# - libgdk-pixbuf2.0-0
33-
# - libpango1.0-0
34-
# - libpangocairo-1.0-0
35-
# - shared-mime-info
36-
3734
RUN apt-get update && \
3835
apt-get install -y --no-install-recommends \
3936
build-essential \
40-
libcairo2 \
37+
libcairo2-dev \
4138
libffi-dev && \
4239
apt-get clean && \
4340
rm -rf /var/lib/apt/lists/*

README.md

+13-18
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
</div>
1717

1818
> [!WARNING]
19-
**This bot (without plenty of tweaking) is not ready for production use, we suggest against using it until announced. Join our support server: [atl.dev](https://discord.gg/gpmSjcjQxg) for more info!**
19+
**This bot is still a work in progress and issues are expected. If you self-host our bot please join our support server [here](https://discord.gg/gpmSjcjQxg) for announcements and support.**
2020

2121
## About
2222

23-
Tux is an all in one Discord bot for the All Things Linux Discord server.
23+
Tux is an all in one Discord bot originally designed for the All Things Linux Discord server.
2424

2525
It is designed to provide a variety of features to the server, including moderation, support, utility, and various fun commands.
2626

@@ -31,7 +31,6 @@ It is designed to provide a variety of features to the server, including moderat
3131
- Docker and Docker Compose for development and deployment
3232
- Strict typing with Pyright and type hints
3333
- Type safe ORM using Prisma
34-
- PostgreSQL database with Supabase
3534
- Linting and formatting via Ruff and Pre-commit
3635
- Justfile for easy CLI commands
3736
- Beautiful logging with Loguru
@@ -56,7 +55,7 @@ It is designed to provide a variety of features to the server, including moderat
5655

5756
- Python 3.13
5857
- [Poetry](https://python-poetry.org/docs/)
59-
- [Supabase](https://supabase.io/)
58+
- [Supabase](https://supabase.io/) or any PostgreSQL database
6059
- Optional: [Docker](https://docs.docker.com/get-docker/)
6160
- Optional: [Docker Compose](https://docs.docker.com/compose/install/) (see the [development notes](#development-notes) for more information)
6261
- Optional: [Just](https://github.com/casey/just/)
@@ -73,35 +72,31 @@ Further detailed instructions can be found in the [development guide](docs/devel
7372
git clone https://github.com/allthingslinux/tux && cd tux
7473
```
7574

76-
2. Install the project's dependencies
75+
2. Install the project's dependencies and set up the virtual environment
7776

7877
```bash
7978
poetry install
79+
poetry env use 3.13
8080
```
8181

82-
3. Activate the virtual environment
83-
84-
```bash
85-
poetry shell
86-
```
87-
88-
4. Install the pre-commit hooks
82+
3. Install the pre-commit hooks (optional unless you are contributing)
8983

9084
```bash
9185
pre-commit install
9286
```
9387

94-
5. Generate the prisma client
88+
4. Generate the prisma client and push the database schema
9589

9690
```bash
9791
prisma generate
92+
prisma db push
9893
```
9994

10095
Currently, you will need to have a Supabase database set up and the URL set in the `DATABASE_URL` environment variable.
10196

10297
In the future, we will provide a way to use a local database. We can provide a dev database on request.
10398

104-
6. Copy the `.env.example` file to `.env` and fill in the required values.
99+
5. Copy the `.env.example` file to `.env` and fill in the required values.
105100

106101
```bash
107102
cp .env.example .env
@@ -111,7 +106,7 @@ Further detailed instructions can be found in the [development guide](docs/devel
111106
112107
We offer dev tokens on request in our Discord server.
113108
114-
7. Copy the `config/settings.yml.example` file to `config/settings.yml` and fill in the required values.
109+
6. Copy the `config/settings.yml.example` file to `config/settings.yml` and fill in the required values.
115110
116111
```bash
117112
cp config/settings.yml.example config/settings.yml
@@ -121,16 +116,16 @@ Further detailed instructions can be found in the [development guide](docs/devel
121116
122117
You can also add your custom prefix here.
123118
124-
8. Start the bot!
119+
7. Start the bot!
125120
126121
```bash
127122
poetry run python tux/main.py
128123
```
129124
130-
9. Run the sync command in the server to sync the slash command tree.
125+
8. Run the clear tree command in the server to sync the slash command tree.
131126
132127
```bash
133-
{prefix}dev sync <server id>
128+
{prefix}dev ct
134129
```
135130
136131
## Development Notes

config/settings.yml.example

+57-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,67 @@
1-
# config/settings.yml
1+
# This is a example configuration file for Tux
2+
# Change the values to your liking and rename the file to settings.yml
3+
4+
BOT_INFO:
5+
PROD_PREFIX: "$"
6+
DEV_PREFIX: "~" # You can enable dev mode in .env
7+
BOT_NAME: "Tux" # This may not apply everywhere, WIP (Best to keep it as Tux for now). Help command will be changed to be less Tux-specific if you change this.
8+
BOT_VERSION: "git" # vX.Y.Z or git
9+
HIDE_BOT_OWNER: false # Hide bot owner and sysadmin from help command
10+
# Available substitutions:
11+
# {member_count} - total member count of all guilds
12+
# {guild_count} - total guild count
13+
# {bot_name} - bot name
14+
# {bot_version} - bot version
15+
# {prefix} - bot prefix
16+
ACTIVITIES: |
17+
[
18+
{"type": "watching", "name": "{member_count} members"},
19+
{"type": "listening", "name": "{guild_count} guilds"},
20+
{"type": "playing", "name": "{bot_name} {bot_version}"},
21+
{"type": "watching", "name": "All Things Linux"},
22+
{"type": "playing", "name": "with fire"},
23+
{"type": "watching", "name": "linux tech tips"},
24+
{"type": "listening", "name": "mpd"},
25+
{"type": "watching", "name": "a vast field of grain"},
26+
{"type": "playing", "name": "i am calling about your car's extended warranty"},
27+
{"type": "playing", "name": "SuperTuxKart"},
28+
{"type": "playing", "name": "SuperTux 2"},
29+
{"type": "watching", "name": "Gentoo compile..."},
30+
{"type": "watching", "name": "Brodie Robertson"},
31+
{"type": "listening", "name": "Terry Davis on YouTube"},
32+
{"type": "playing", "name": "with Puffy"},
33+
{"type": "watching", "name": "the stars"},
34+
{"type": "watching", "name": "VLC"},
35+
{"type": "streaming", "name": "SuperTuxKart", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
36+
]
237

3-
DEFAULT_PREFIX:
4-
PROD: "$"
5-
DEV: "~"
638

739
USER_IDS:
8-
SYSADMINS:
40+
SYSADMINS: # WARNING! This grants dangerous permissions such as eval and jsk which can be used to execute arbitrary code.
941
- 123456789012345679
1042
- 123456789012345679
11-
BOT_OWNER: 123456789012345679
43+
BOT_OWNER: 123456789012345679 # This is the user who has the highest level of control over the bot. Only one user can be the bot owner.
1244

45+
# This adds a temporary voice channel feature to the bot, you can join the channel to create a channel called /tmp/<username> and move to it.
46+
# Channels are deleted when the last person leaves them.
47+
# Set this to the category ID where you want the temporary voice channels to be created.
48+
# Temporary channels will be put at the bottom of the category.
1349
TEMPVC_CATEGORY_ID: 123456789012345679
50+
# Set this to the channel ID where you want the temporary voice channels to be created.
1451
TEMPVC_CHANNEL_ID: 123456789012345679
1552

1653

54+
SNIPPETS:
55+
LIMIT_TO_ROLE_IDS: false # Only allow users with the specified role IDs to use the snippet command
56+
ACCESS_ROLE_IDS:
57+
- 123456789012345679
58+
- 123456789012345679
59+
1760
XP:
18-
XP_BLACKLIST_CHANNELS:
61+
XP_BLACKLIST_CHANNELS: # Channels where XP will not be counted
1962
- 123456789012345679
2063
- 123456789012345679
21-
XP_ROLES:
64+
XP_ROLES: # Roles that will be given to users when they reach a certain level
2265
- level: 5
2366
role_id: 123456789012345679
2467
- level: 10
@@ -30,18 +73,17 @@ XP:
3073
- level: 25
3174
role_id: 123456789012345679
3275

33-
XP_MULTIPLIERS:
76+
XP_MULTIPLIERS: # Multipliers for certain roles
3477
- role_id: 123456789012345679
3578
multiplier: 1.5
3679

37-
XP_COOLDOWN: 1 # In seconds
80+
XP_COOLDOWN: 1 # Delay in seconds between XP messages
3881

39-
LEVELS_EXPONENT: 1
40-
SHOW_XP_PROGRESS: false
41-
# if true, XP will still be counted, but not shown beyond the cap in the level command
42-
ENABLE_XP_CAP: false
82+
LEVELS_EXPONENT: 1 # Exponent for the level formula
83+
SHOW_XP_PROGRESS: false # Shows required XP for the next level in the level command
84+
ENABLE_XP_CAP: false # if true, XP will still be counted, but not shown beyond the cap in the level command
4385

44-
GIF_LIMITER:
86+
GIF_LIMITER: # Limits the amount of gifs a user can send in a channel
4587
RECENT_GIF_AGE: 60
4688

4789
GIF_LIMIT_EXCLUDE:

0 commit comments

Comments
 (0)