TACT is a feature-rich, open-source Discord bot designed to gamify and enhance server engagement by awarding XP, tracking levels, and enabling users to interact through fun commands. This bot is built with Python, Discord.py, and PostgreSQL, and is Dockerized for seamless deployment.
- Leveling System: Users earn XP by messaging and participating in server activities.
- Server Bump Rewards: Users are awarded XP for bumping the server.
- Interactive Fun Commands: Users can “steal” XP, “shoot” each other, and buy virtual items from a store.
- Leaderboard and Server Stats: Displays top users by level and overall server stats.
- Persistent Data: Uses PostgreSQL for data storage.
- Dockerized Setup: Deploy easily using Docker.
-
Clone the Repository:
git clone https://github.com/comon-tech/TACT.git cd TACT
-
Set Up Environment Variables: Rename
.env.example
to.env
and replace with your own values:DISCORD_TOKEN=your-discord-token DATABASE_URL=postgresql://bot_user:bot_password@db:5432/bot_db
-
Install Dependencies:
python install -r requirements.txt
If you are using Python 3.13 you'll probably get this error at runtime:
ModuleNotFoundError: No module named 'audioop'
(Why?)To fix it install
audioop-lts
:pip install audioop-lts
-
Run:
python app.py
Command | Description | Usage |
---|---|---|
/level |
Displays your current level and XP. | /level |
/leaderboard |
Shows the top users by level in the server. | /leaderboard |
/server_stats |
Displays the server's total users, total XP, and average level (admin-only). | /server_stats |
/give_xp |
Grants XP to a user. | /give_xp <@user> <amount> |
/reset_xp |
Resets a user's XP and level (admin-only). | /reset_xp <@user> |
Command | Description | Usage |
---|---|---|
/steal <@user> |
Attempt to steal XP from another user. | /steal <@user> |
/shoot <@user> |
Attempt to shoot another user (for fun). | /shoot <@user> |
/inventory |
Shows the items you currently own. | /inventory |
Command | Description | Usage |
---|---|---|
/store |
Displays available items for purchase and their prices. | /store |
/buy <item> |
Buy an item from the store if you have enough XP. | /buy <item> |
TACT uses (currently a json file but migrating soon) PostgreSQL to store XP, level, and inventory data for persistent tracking across sessions. Docker Compose configures and manages the PostgreSQL container.
We welcome contributions! Please fork this repository, create a branch with your feature or fix, and submit a pull request.
- Fork the repository.
- Clone your fork:
git clone https://github.com/yourusername/TACT.git
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit them:
git commit -m "Add new feature"
- Push to your fork and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.