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.
- Click on the
Use this template
button to create a new repository from this template. - Clone the repository to your local machine.
- Open the project in your favorite IDE.
- Copy the
config.example.toml
file toconfig.toml
and fill in the required fields. - Run the bot using
go run .
- Invite the bot to your server using the invite link generated by discord developer portal.
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 = "..."
The bot template is licensed under the Apache License 2.0.