NOTE: I moved to Rust while developing this bot. See https://github.com/Sir-Photch/dab-rs
Bot that lets users /chime
with a given audio-file or url, that plays each time they connect to a channel on your server.
/chime set url # sets chime of user to given url (that links to a audio-file)
/chime set file # sets chime of user to given attachment
/chime clear # clears chime of user, if present
If some user connects to a channel, the bot will join that channel and play the chime of the user, if configured. After playing, the bot will leave.
When multiple users connect at the same time, their chimes will be queued and played in first come, first serve-order.
Clone this repo and build it for your platform, or download the current release. Consider dependencies needed to run.
On first startup, the bot will exit stating that a default-config has been created. You need to add your Discord-API-Key in config.json
.
The auto-generated config.json
in the working directory of the bot contains various parameters that can be adjusted.
Currently, the config consists of:
{
"DiscordParams": {
"ApiKey": "foo bar baz",
"AudioBufferMs": 25
},
"BotParams": {
"ChimeDurationMaxMs": 10000,
"ChimeFilesizeMaxKb": 5000,
"ChimePlaybackTimeoutMs": 10000
}
}
"ApiKey":
string containing your unique discord-api-token"AudioBufferMs":
unsigned integer containing the buffer-duration of discord-audio-stream. Must be greater than 1. For bigger values, short chimes may not be played."ChimeDurationMaxMs":
signed integer containing the maximum duration of a chime, in milliseconds. For no limit, set -1."ChimeFilesizeMaxKb":
signed integer containing the maximum filesize a user can upload, in kilobytes. For no limit, set -1."ChimePlaybackTimeoutMs":
signed integer containing the maximum duration after playing a chime will time out, in milliseconds. This is recommended to be set. For no limit, set -1
In general, the default settings will work out most of the time.
- playback stutters on weaker machines
- Chimes are queued when bot is in other channel than joinee, but not played until some other user joins into the same channel
Kudos to you for scrolling this far! If you want to contribute, see CONTRIBUTING.md.