A fun Discord bot with the features described in utils\help.go.
The code is organized as follows:
constants/: constant valuesdb/: database-related functionality. Stores persistent data on disk using the bbolt library for later fetching.discord/: logic specific to Discord. This bot might eventually evolve to interact with multiple services/APIs so this is where anything Discord-specific lives. The bot listens and responds to events from the Discord API by utilizing the discordgo library.errors/: custom error typesmodels/: model object typesscheduler/: code related to scheduled eventsutils/: utility functionsworkflows/: these are the "features" of the bot. After triggers have arrived we execute workflows which contain the "since this happened, do this" logic. Ideally these workflows are agnostic to the models of any specific service or API.
- To install the bot for testing in a new server, you'll need to create a new application in the Discord developer portal:
- Name it whatever you want (e.g.
JacuzziBot Dev<YourName>). - Under
Installationtab:- Uncheck
User Install - Under
Default Install Settings > Guild install:- Under
Scopes, addbot.applications.commandsshould already be there. - Under
Permissions, add:Add ReactionsAttach FilesCreate PollsEmbed LinksMention EveryoneRead Message HistorySend MessagesSend Messages in ThreadsView Channels
- Under
- Uncheck
- Under
Bottab:- Press
Reset Token, and then copy the new token. Save it somewhere safe (e.g. a password manager). - Under
Authorization Workflow:- Enable
Server Members Intent - Enable
Message Content Intent - Note: it is fine to leave
Public Botenabled as long as you don't share your installation link with anyone. Making a bot publicly discoverable is a different process.
- Enable
- Press
- Name it whatever you want (e.g.
- After you've created and configured your test app, create a new Discord server for testing the bot in.
- To install the test app in your new server, go to the
Installationtab in the developer portal for your app.- Open the
Install Linkin your browser. This should redirect you to Discord to install your app in a server of your choice.
- Open the
- Install Go >= 1.25.5: https://go.dev/doc/install.
- Set your
DISCORD_TOKENenvironment variable to your app's Discord auth token that you saved earlier.- If you're developing in VS Code you can permanently store your token in the PowerShell terminal like this:
setx DISCORD_TOKEN "...". You'll need to restart VS Code before this change takes effect. Verify withecho $env:DISCORD_TOKEN.
- If you're developing in VS Code you can permanently store your token in the PowerShell terminal like this:
go run .to both compile and run the app executable locally.- Once it's running, your client should pick up the commands so you can start using them within about 5 seconds.
Ctrl+Cin your terminal to stop the bot program and exit cleanly.
Example local output:
...\JacuzziBot> go run .
2025/12/29 21:19:39 JacuzziBot is now running. Press CTRL-C to exit.
2025/12/29 21:19:39 Discord session opened and waiting for events.
2025/12/29 21:19:51 Incoming message by 123456789012345678 (Sally): Hi everyone!
2025/12/29 21:19:51 User 123456789012345678 (Sally) gained 10.00 points, for a total of 20.00 points.
2025/12/29 21:19:58 JacuzziBot shutting down.
2025/12/29 21:19:58 Discord session closed.
This project is licensed open-source under the MIT License.