- Advanced moderation system.
- Lots of utility & fun commands.
- Advanced music system with support for YouTube, Spotify and SoundCloud.
- Clean & informative help menu.
-
Clone this repository
git clone https://github.com/swayam25/Square-Bot square cd square
-
Create
config.toml
fromexample.config.toml
and 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.
-
emoji
(Literal["default", "custom"]
)- Emoji type.
default
will use default emojis.custom
will use custom emojis defined in.cache/emoji.json
(requires setting up custom emojis).- If you choose
custom
, make sure to define the emojis in the.cache/emoji.json
file.- To create custom emojis, upload a
.zip
file containing the emojis (.png
format) using/emoji upload
command. - Emoji file names must match the attributes of
Emoji
class inemoji.py
. - Then run
/emoji sync
command to sync the emojis. (This creates.cache/emoji.json
file from bot's emojis). - You can also manually create the
.cache/emoji.json
file with the same structure asEmoji
class inemoji.py
. - Then set the
emoji
field tocustom
.
- To create custom emojis, upload a
-
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.
error
(str
)- Error color.
-
[lavalink]
host
(str
)- Lavalink host.
port
(int
)- Lavalink port.
password
(str
)- Lavalink password.
secure
(bool
)- Lavalink secure status
-
[spotify]
client_id
(str
)- Spotify client id
client_secret
(str
)- Spotify client secret
-
-
Set spotify credentials in
config.toml
file.- Go to Spotify Developer Dashboard.
- Create a new application (visit Spotify Developer Docs for more details).
- Get the
client_id
andclient_secret
from the application settings. - Set the
client_id
andclient_secret
in theconfig.toml
file.
-
Start the bot.
uv run main.py
Important
Make sure to have uv installed on your system to run the bot. Know more about installing uv here.
-
Follow steps 1-3 from the installation guide. Ignore if already done.
-
Run docker container (via
docker compose
)docker compose up -d
-
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 format
before committing your changes or useRuff
extension in your code editor. - Make sure to commit error free code. Run
ruff check
to check for any errors.
- Run