https://github.com/abhinav2712/release-bot
A Discord bot for managing weekly release threads
https://github.com/abhinav2712/release-bot
bot developer-tools discord discord-bot go golang release
Last synced: about 1 month ago
JSON representation
A Discord bot for managing weekly release threads
- Host: GitHub
- URL: https://github.com/abhinav2712/release-bot
- Owner: abhinav2712
- Created: 2026-04-19T14:20:13.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-20T09:33:39.000Z (3 months ago)
- Last Synced: 2026-04-20T11:33:46.827Z (3 months ago)
- Topics: bot, developer-tools, discord, discord-bot, go, golang, release
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Release Bot
A Discord bot for managing weekly release threads โ built in Go using [`discordgo`](https://github.com/bwmarrin/discordgo).
PMs initialize a release, developers add and update their branches, and the bot keeps a live summary message in the thread updated automatically.
---
## Features
- ๐ Create release threads with one command
- โ Add branch entries grouped by **Frontend** or **Backend**
- โ๏ธ Update your own entries via guided dropdowns
- โ Remove a branch from the release (shown struck-through in the thread, excluded from summary counts)
- ๐ Instant ephemeral summary of release status
- ๐ Thread-safe in-memory state
---
## Commands
| Command | Who | What it does |
|---|---|---|
| `/ping` | Anyone | Health check โ responds `Pong ๐` |
| `/release-init` | PM | Starts a new release (type โ date โ notes โ thread) |
| `/release-add` | Developer | Adds a branch entry โ choose **Frontend** or **Backend** first, then status |
| `/release-update` | Developer | Updates a branch entry โ or removes it from the release |
| `/release-summary` | Anyone | Shows an ephemeral count snapshot by status (removed entries excluded) |
---
## Setup Guide
### Prerequisites
- [Go](https://go.dev/dl/) installed (`go 1.21+` recommended)
- A Discord account
- Permission to add bots to the target server
---
### 1. Clone the repository
```bash
git clone https://github.com/abhinav2712/release-bot.git
cd release-bot
```
---
### 2. Create a Discord application
1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)
2. Click **New Application** and give it a name
3. Navigate to the **Bot** section
4. Click **Add Bot** โ confirm
5. Under **Token**, click **Reset Token** and copy it
> This is your `DISCORD_TOKEN`. Keep it secret.
---
### 3. Invite the bot to your server
1. In the Developer Portal, open **OAuth2 โ URL Generator**
2. Select scopes:
- โ
`bot`
- โ
`applications.commands`
3. Select bot permissions:
- โ
View Channels
- โ
Send Messages
- โ
Read Message History
- โ
Manage Threads
4. Copy the generated URL, open it in your browser, and add the bot to your server
---
### 4. Get your Guild ID (Server ID)
1. Open Discord
2. Go to **User Settings โ Advanced**
3. Enable **Developer Mode**
4. Right-click your server name in the sidebar
5. Click **Copy Server ID**
> This is your `GUILD_ID`.
---
### 5. Set up environment variables
Copy the example file and fill in your values:
```bash
cp .env.example .env
```
```env
DISCORD_TOKEN=your_bot_token_here
GUILD_ID=your_server_id_here
```
| Variable | Description |
|---|---|
| `DISCORD_TOKEN` | Bot token from the Discord Developer Portal |
| `GUILD_ID` | ID of the server where slash commands are registered |
---
### 6. Install dependencies
```bash
go mod tidy
```
---
### 7. Run the bot
```bash
go run cmd/bot/main.go
```
If everything is configured correctly, you'll see:
```
Bot is ready!
Bot is running...
```
---
### 8. Test it out
In your Discord server, run:
```
/ping
```
If the bot replies with `Pong ๐`, you're good to go.
---
## Release Flow
```
PM runs /release-init
โโ selects release type (major / minor)
โโ selects release date
โโ enters release notes in modal
โโ bot creates a thread + posts a live summary message
Developers run /release-add
โโ choose layer (Frontend / Backend)
โโ select status
โโ fill in branch, title, PR link, blocker in modal
โโ summary thread updates with FE / BE grouping
Developers run /release-update
โโ select their branch
โโ select new status
โโ normal status โ fill in updated PR / blocker in modal โ summary updates
โโ "Remove from Release" โ no modal, branch instantly struck through in thread
Anyone runs /release-summary
โโ receives an ephemeral count breakdown (removed branches excluded)
```
---
## Project Structure
```
release-bot/
โโโ cmd/bot/main.go # Entry point โ env, session wiring, signal handling
โโโ internal/
โโโ models/release.go # ReleaseItem and CurrentRelease types
โโโ state/store.go # Thread-safe in-memory state store
โโโ status/status.go # Status helpers, emoji map, date options
โโโ discord/respond.go # Interaction response helpers
โโโ summary/builder.go # Summary message builder
โโโ handlers/
โโโ router.go # Top-level interaction dispatcher
โโโ release_init.go # /release-init flow
โโโ release_add.go # /release-add flow
โโโ release_update.go # /release-update flow
โโโ release_summary.go # /release-summary
```
---
## Status Reference
| Status | Emoji | Meaning |
|---|---|---|
| `in-progress` | ๐ ๏ธ | Work is ongoing |
| `given-for-review` | ๐ | Shared for review |
| `reviewed` | โ
| Review is complete |
| `tested` | ๐งช | Testing is complete |
| `reviewed-and-tested` | ๐ | Ready to ship |
| `removed` | โ | Removed from the release โ struck-through in thread, excluded from counts |
> [!NOTE]
> The `removed` status is only available via `/release-update`. It cannot be set when first adding an entry with `/release-add`.
---
## Troubleshooting
**Slash commands are not showing up**
- Make sure the bot was invited with `applications.commands` scope
- Verify `GUILD_ID` matches the correct server
- Confirm the bot is running
**"Missing Access" error**
- The bot is not in the server, or was invited without the correct scopes
- Double-check the invite URL was generated with both `bot` and `applications.commands`
**`.env` values are not being read**
- The `.env` file must be in the project root, the same directory you run the command from
---
## Security
> [!CAUTION]
> Never commit your real `.env` file or bot token to version control.
> Only commit `.env.example` with empty values.
> If your token is ever exposed, reset it immediately from the [Discord Developer Portal](https://discord.com/developers/applications).
---
## License
MIT