Skip to content

swayam25/Square-Bot

Repository files navigation

Square Bot

Advanced multipurpose discord bot for all your needs.

🎯 Features

  • 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.

🚩 Installation

  1. Clone this repository

    git clone https://github.com/swayam25/Square-Bot square
    cd square
  2. Create config.toml from example.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.
        1. To create custom emojis, upload a .zip file containing the emojis (.png format) using /emoji upload command.
          • There is a zip file of custom emojis that are used in this bot. Upload the emojis.zip via /emoji upload command.
          • Emoji file names must match the attributes of Emoji class in emoji.py. The emojis.zip file already does this for you.
        2. Run the /emoji sync command to sync the emojis to .cache/emoji.json.
        3. Then set the emoji field to custom.
    • 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 with asyncpg://.
        • Services like Supabase provide a postgresql:// connection string, remember to change it to asyncpg://.
    • [colors]

      • theme (str)
        • Theme color.
      • error (str)
        • Error color.
    • [lavalink]

      • host (str)
        • Lavalink host.
      • port (int)
        • Lavalink port.
      • password (str)
        • Lavalink password.
      • region (str)
        • Lavalink region.
      • secure (bool)
        • Lavalink secure status
  3. 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.

🚀 Production

  1. Follow steps 1 & 2 from the installation guide. Ignore if already done.

  2. Run docker container (via docker compose)

    docker compose up -d

❤️ Contributing

  • 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 use Ruff extension in your code editor.
    • Make sure to commit error free code. Run ruff check to check for any errors.

About

Advanced multipurpose discord bot for all your needs

Topics

Resources

License

Stars

Watchers

Forks