- Advanced moderation system.
- Lots of utility & fun commands.
- Advanced music system with support for various sources (depends on your Lavalink server).
- Clean & informative help menu.
- Supports Discord Components v2.
-
Clone this repository
git clone https://github.com/swayam25/Square-Bot square cd square -
Create
config.tomlfromexample.config.tomland fill in the required values.Configuration
-
owner-id(int)- Owner's discord id.
- Gives access to all commands.
-
owner-guild-ids(list[int])- List of guild ids.
- Developer commands will only work in these guilds.
-
system-channel-id(int)- System channel id.
- Bot will send logs in this channel.
-
support-server-url(str)- Support server url.
- Bot will use this url for support server.
-
bot-token(str)- Discord api token.
- Bot will use this token to connect to discord.
-
database-url(str)- Database url.
- Bot will use this url to connect to the database.
- Postgres database is supported.
- Example:
asyncpg://user:password@db.host:5432/square.- If your connection string starts with
postgresql://, replace it withasyncpg://. - Services like Supabase provide a
postgresql://connection string, remember to change it toasyncpg://.
- If your connection string starts with
-
[colors]theme(str)- Theme color.
green(str)- Green color.
red(str)- Red color.
orange(str)- Orange color.
-
[lavalink]host(str)- Lavalink host.
port(int)- Lavalink port.
password(str)- Lavalink password.
region(str)- Lavalink region.
secure(bool)- Lavalink secure status
-
-
Start the bot.
uv run main.py
Important
Make sure to have uv installed on your system to run the bot. Learn more about installing uv here.
-
Follow steps 1 & 2 from the installation guide. Ignore if already done.
-
Run docker container (via
docker compose)docker compose up -d
- To create custom emojis, upload a
.zipfile containing the emojis (.pngformat) using/emoji uploadcommand. - There is a zip file containing custom emojis that are used in this bot.
- Upload the
emojis.zipvia/emoji uploadcommand. - Run the
/emoji synccommand to sync the emojis to.cache/emoji.json. - Restart the bot to apply the changes.
- Emojis are synced (when you run the
/emoji synccommand) based on their file names, which must match the attribute names of theEmojiclass inemoji.py. - Collect all the emojis you want the bot to use and name each file according to the corresponding attribute in the
Emojiclass. - Compress all the emoji files into a single
.ziparchive. - Upload this archive using the
/emoji uploadcommand. - After uploading, run the
/emoji synccommand to sync the emojis to.cache/emoji.json. - Restart the bot to apply the changes.
Alternatively, you can manually create a .cache/emoji.json file with the following structure:
{
"emoji_name": "<a:dc_emoji_name:dc_emoji_id>",
"emoji_name": "<:dc_emoji_name:dc_emoji_id>"
}emoji_namemust match the corresponding attribute name in theEmojiclass.<a:...>denotes an animated emoji, while<:...>denotes a static emoji.dc_emoji_namerefers to the name of the emoji as it appears in Discord.dc_emoji_idis the unique identifier of the emoji in Discord.
Note
If a custom emoji is missing for any attribute in .cache/emoji.json, the bot will automatically use the default emoji from the Emoji class.
-
Things to keep in mind
- Follow our commit message convention.
- Write meaningful commit messages.
- Keep the code clean and readable.
- Make sure the bot is working as expected.
-
Code Formatting
- Run
ruff formatbefore committing your changes, or useRuffextension in your code editor. - Ensure the bot is working as expected. Run
ruff checkto check for any errors.
- Run
