domo
domo is a Discord bot to help you manage your FOMO (fear of missing out).
Development
Download and install Go: Instructions
To run the bot first grab the token from the bot page. It needs to be included in the run command below:
go run cmd/bot/main.go -t ${TOKEN_GOES_HERE}
This registers the bot to listen for events in the Dev Server. It overrides the default/main config.json
which is used in the deployed bot.
To run the bot using the main config:
go run cmd/bot/main.go -t ${TOKEN_GOES_HERE} -c config/bot_main.json
Deployment
First ensure gcloud
is installed (Instructions):
# Install ko
go install github.com/google/ko@latest
export KO_DOCKER_REPO=northamerica-northeast2-docker.pkg.dev/domo-334121/domo
gcloud auth configure-docker northamerica-northeast2-docker.pkg.dev
ko publish ./cmd/bot/
From there go to the Cloud Run page and push a new instance, selecting latest image. All of the secrets/configs/run server are manually configured.
Discord App setup
- Visit https://discord.com/developers/applications
- Create a new application
- Within the app go to "Bot section and create a bot
- Disable "Public Bot": this prevents random people adding it to their servers
- Enable "Presence Intent": provides access to view user presence updates
Add to a Server
Complete the authorization flow by visiting the following link:
This link identifies the domo
app id and includes the required permission set:
- Read Messages/View Channels
- Send Messages
- Send Messages in Threads
Register domo update channel
Each server domo is added to must be added to the domo config. This is inconvenient but is fine for the initial intent of using this in only a few servers. It also saves the hassle of integrating a secondary storage system.
Update cmd/bot/config.json
with the server's GuildID
and a channel ID where domo
has permission to post messages. This channel is where domo
will publish its update messages.
Links
- Deployment Links
- discordgo docs: https://pkg.go.dev/github.com/bwmarrin/discordgo
- Useful Guides
- Google Cloud docs
- Discord API pages