Welcome to Titanium's main code repo! Titanium is your multipurpose, open source Discord bot.
Add Titanium Now! (you will agree to the Privacy Policy and Terms of Use policy)
Titanium v2 includes many features designed to improve your Discord experience, such as:
- complete rewrite of Titanium v1 to include better code and SQLAlchemy ORM
- full user app support with info commands, Spotify commands, image commands and more
- prefix and slash commmand support
- fully custom web dashboard written in SvelteKit
- advanced moderation and automod features
- bouncer to monitor users as they join and update their profiles
- logging to keep a log of events that happen in your server
- fireboard and leaderboard to increase server engagement
- server counters for live updating stats in the channel list
- confessions to allow users to write anonymous messages, with logging for moderators
- tags to allow you to send quick responses to messages
- and more!
Important
Due to developer workload, I am only accepting PRs for minor features or bug fixes at this time. Please create an issue or discussion first before creating a PR, to allow me to review your request.
Caution
You will need to run a PostgreSQL server to run the bot. Additionally, Titanium v2 is only tested to run on macOS and Linux. Windows support is untested, and may have unexpected issues.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License in the licence file for more details.
- Create a PostgreSQL 18 database - this can be done with Docker or similar tools
- Note down the username and password, add these to the .env file along with the host, port and database name
- Download and install the Atlas CLI (you may also need to install Docker)
- When you run the bot, the bot will automatically create required tables in the database and complete any needed migrations
When developing, you may modify, add or remove tables. To migrate the database to the new schema, follow these steps:
- If you're adding or removing a table, make sure to also add / remove it from the
lib/sql/atlas.pyfile. - Run
atlas migrate diff --env sqlalchemy- this will create a migration file in the/migrationsfolder - Review the created migration file to ensure that it looks accurate
Important
If you have manually modified a migration file, you will need to run atlas migrate hash, otherwise the migration process will fail.
Once you have generated your migration file, or if you have pulled in new migration files from an update, you should now migrate the database. Run the t!admin migrate-db command, restart the bot, or use the --migrate argument on main.py. The database must be running to complete the migration.
Titanium requires some fonts to be downloaded to use features such as the image caption feature. To use these features, please download:
- Figtree Font (figtree.ttf)
- Impact Font (impact.ttf)
- Futura Condensed Font (futura.otf)
Once required fonts have been downloaded, place them into the lib/fonts folder.
It is recommended to run the Titanium Dashboard alongside the Titanium bot. This allows you to manage Titanium's settings from a web browser. This is required to manage some features of Titanium, such as the automod and bouncer system.
- Ensure that you have filled out the .env file with any required information
- Install the
uvpackage manager - other package managers may work, but I develop with uv in mind - Ensure that the database is running, as per the instructions above
- Run
uv run main.py- a Python venv will be created and any required packages will be installed - Watch the terminal output for any errors that may appear
If you are moving from Titanium v1 to v2, you should migrate user data so users do not lose their preferences and data. Titanium v2 comes with an official migration script that will move Titanium v1 data to appropriate places in Titanium v2.
Currently, the migration script can migrate fireboard, leaderboard, server counter settings / data, and server / user tags.
- Make sure to cleanly stop Titanium v1 so all pending database writes can be completed.
- Copy the applicable databases from the
content/sqlfolder in Titanium v1 to thev1_to_v2/dbsfolder in Titanium v2. - Run Titanium v2 with the
--v1tov2argument from the root folder (folder that containsmain.py), eg.uv run main.py --v1tov2. - Follow the steps in the terminal to complete the migration. Once done, the bot will exit.
If you have more data to migrate, simply place the new databases into the folder and start the migration script again. Data already migrated will not be overwritten.