A bot written using discord.py for my Discord server. What is the purpose? I don't know... just to have a fun little bot for the community. This was originally created in 2018 to send random images of Josh, but was remade and has been the primary bot on my server since 2022 (with a complete rewrite in August 2025!).
The core idea is based around a central database, from which all data is represented and interacted with through commands. While some commands and functionality may not need the database, the primary function is to give the user a custom "profile" with accolades and statistics for their time in the server.
This is a brief overview of the tables in the database and their purpose, for all attributes or typing please check the schema in core/database.py's Connection.__build__() method.
- Users - stores user information such as Discord
id, customname,joinedandactivetimestamps, etc. - Badges - stores badges (rewards for users) including identifiers and an
imagepath, etc. - UserBadges - referencing table, entries representing a badge that a user owns as a (user id, badge id) pair
- Quests - stores quests (challenges for server members) with a message
id,tierof difficulty,expirestimestamp, etc. - UserQuests - referencing table, for each user id there are counts of each quest tier completed
- bot.py - the main for the bot
- core/common.py - for common constants and static functions shared between cogs
- core/database.py - implements database operations in a simple class-hierarchical structure
- cogs/users.py commands that interact with the
Userstable (i.e. custom profiles, level system) - cogs/badges.py commands related to user awarded badges, (
BadgesandUserBadgestables) - cogs/quests.py commands implementing member quests, (
QuestsandUserQueststables) - cogs/fun.py extra commands that serve no "practical" purpose
- cogs/server.py commands for roles management and moderation
- cogs/tasks.py holding all the task loops for database/temp cleanup and other repetitive needs
- Major rewrite to move all direct database interaction into a separate file
- "Open source" the bot so that server members can contribute
- Integration with other websites (Twitch, osu!, etc.)