1
0
Fork
You've already forked rolebot
0
a super simple bot for setting roles on discord.
  • Go 100%
Find a file
2026年01月19日 13:26:58 +11:00
.gitignore Initial commit. 2025年09月18日 07:26:01 +10:00
config.go List available guilds and roles on startup. 2025年09月18日 08:21:00 +10:00
go.mod Initial commit. 2025年09月18日 07:26:01 +10:00
go.sum Initial commit. 2025年09月18日 07:26:01 +10:00
interaction.go Refactor role setting logic. 2025年09月19日 19:53:13 +10:00
LICENSE Initial commit. 2025年09月18日 07:26:01 +10:00
main.go roles list is now a prettier content component. 2026年01月19日 13:26:58 +11:00
README.md Update README.md 2025年09月18日 11:13:16 +10:00
rolebot.service Add systemd service. 2025年09月18日 08:40:36 +10:00
roleslist.go roles list is now a prettier content component. 2026年01月19日 13:26:58 +11:00

Rolebot

a super simple bot for setting roles on discord. meant to be self hosted and used on directly managed servers only.

Build and install

build the go module with go build and then install the binary to /usr/local/bin/rolebot for the included systemd service (rolebot.service) to work. the service should be installed into /etc/systemd/system/rolebot.service or wherever and then enabled with systemctl enable --now rolebot.

Config

the default config directory is /etc/rolebot/. the environment variable CONFIG_DIR can be set for an alternate directory.

config directory structure:

/etc/rolebot/
 |- token (contains the discord bot token)
 |- appid (contains the application ID)
 -- guilds/ (contains per-guild config)
 - <guild_id>.toml (detailed below)

guilds/<guild_id>.toml

per-guild configuration as a list of role groups. example config:

# /etc/rolebot/guilds/1234.toml
[[RoleGroups]]
Heading = "Group 1"
Description = "Some group of roles"
Multiple = false # allow multiple roles from this group?
Roles = [
 "1234", # role IDs must be strings
 "5678",
]
[[RoleGroups]]
Heading = "Group 2"
Description = "Some other group"
Multiple = true
Roles = [
 "7890",
 "0987",
]