Skip to content

disgoorg/bot-template

Repository files navigation

Go Report Go Version License Docker Test

bot-template

This is a simple bot template for creating a bot which includes a config, application commands, components modals(using handler and event listeners.

CLI Flags:

  • --config-path=your-config-path: Path to the config file.
  • --sync-commands=true: Synchronize commands with the discord.

Usage

  1. Click on the Use this template button to create a new repository from this template.
  2. Clone the repository to your local machine.
  3. Open the project in your favorite IDE.
  4. Copy the config.example.toml file to config.toml and fill in the required fields.
  5. Run the bot using go run .
  6. Invite the bot to your server using the invite link generated by discord developer portal.

Configuration

The configuration file is in TOML format. The format is as follows:

[log]
# valid levels are "debug", "info", "warn", "error"
level = "info"
# valid formats are "text" and "json"
format = "text"
# whether to add the log source to the log message
add_source = true

[bot]
# add guild ids the commands should sync to, leave empty to sync globally
dev_guilds = []
# the bot token
token = "..."

License

The bot template is licensed under the Apache License 2.0.