https://github.com/mgerb/go-discord-bot
Discord sound bot to play and record sound clips
https://github.com/mgerb/go-discord-bot
dca discord go opus react soundboard
Last synced: 4 months ago
JSON representation
Discord sound bot to play and record sound clips
- Host: GitHub
- URL: https://github.com/mgerb/go-discord-bot
- Owner: mgerb
- Created: 2017-01-13T22:31:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T03:03:36.000Z (about 3 years ago)
- Last Synced: 2025-05-06T14:16:21.865Z (about 1 year ago)
- Topics: dca, discord, go, opus, react, soundboard
- Language: Go
- Homepage: https://hub.docker.com/r/mgerb/go-discord-bot/
- Size: 71.9 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Discord Sound Bot
A soundboard bot for discord. Built with Go/React.

## How to use
- [Download latest release here](https://github.com/mgerb/go-discord-bot/releases)
- Install [yt-dlp](https://github.com/yt-dlp/yt-dlp)
- Install [ffmpeg](https://www.ffmpeg.org/download.html)
- edit your config.json file
- `docker-compose up`
- go to http://localhost:8088
### With docker-compose
Make sure to create a `config.json` file in your data volume.
Take a look at `config.template.json` for example configurations.
docker-compose.yml
```
version: "3"
services:
go-discord-bot:
image: mgerb/go-discord-bot:latest
restart: unless-stopped
ports:
- 8088:8080
volumes:
- :/bot
- /usr/local/bin/youtube-dl:/usr/bin/youtube-dl
```
#### Running Bot Scripts
Use the following scripts
- restore-messages
- used to search message history and store in database
- update-db
- used to run additional DB change scripts (will likely never have to be run)
Example:
```
docker-compose exec go-discord-bot /server/bot-scripts update-db
docker-compose exec go-discord-bot /server/bot-scripts restore-message
```
### Commands
- `clip` - clips the past minute of audio
- `summon` - summons the bot to your current channel
- `dismiss` - dismisses the bot from the server
- `` - play a named audio clip
- `random` - play a random audio clip
### Uploading files
Discord oauth is used to authenticate users in order to upload files.
To get oauth working you must set up your bot client secret/id in the config.
You must also set up the redirect URI. This is needed so discord can redirect
back to your site after authentication. Discord doesn't like insecure redirects
so you will have to use a proxy for this. I prefer using [caddy](https://github.com/mholt/caddy)
with the following config.
```
https://localhost {
tls self_signed
proxy / http://localhost:8080 {
transparent
}
}
```
For public hosting you will want to use something like this.
```
https:// {
tls
proxy / http://localhost:8080 {
transparent
}
}
```
### Stats
If logging is enabled the bot will log all messages and store in a database file. Currently the bot keeps track of
all messages that contain links in them. I added this because it's something we use in my discord.
Check it out in the "Stats" page on the site.
## Building from Source
### Dependencies
- Go (1.17+)
- node/npm (node 16)
### Compiling and Running
- `cd client && npm install && npm run build`
- `cd server && go build -o ../bot`
- `./bot`