Add DefaultComment configuration option

pull/42/head
Matthieu Grieger 2015-02-09 15:08:09 -08:00
parent 44e0d55d9d
commit e251b0ccda
4 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,9 @@
MumbleDJ Changelog
==================
### February 9, 2015 -- `v2.4.3`
* Added configuration option in `mumbledj.gcfg` for default bot comment.
### February 7, 2015 -- `v2.4.2`
* Updated `gumble` and `gumbleutil` dependencies.
* Removed `sanitize` dependency.

View File

@ -8,7 +8,7 @@
package main
import (
"crypto/tls"
"crypto/tls"
"flag"
"fmt"
"github.com/layeh/gopus"
@ -59,6 +59,8 @@ func (dj *mumbledj) OnConnect(e *gumble.ConnectEvent) {
}
dj.client.AudioEncoder().SetApplication(gopus.Audio)
dj.client.Self().SetComment(dj.conf.General.DefaultComment)
}
// OnDisconnect event. Terminates MumbleDJ thread.

View File

@ -17,6 +17,11 @@ SkipRatio = 0.5
# DEFAULT VALUE: 0.5
PlaylistSkipRatio = 0.5
# Default comment to be applied to bot.
# DEFAULT VALUE: "Hello! I am a bot. Type !help for a list of commands."
# NOTE: If you do not want a comment by default, set the variable equal to an empty string ("").
DefaultComment = "Hello! I am a bot. Type !help for a list of commands."
[Volume]

View File

@ -19,6 +19,7 @@ type DjConfig struct {
CommandPrefix string
SkipRatio float32
PlaylistSkipRatio float32
DefaultComment string
}
Volume struct {
DefaultVolume float32
@ -39,7 +40,7 @@ type DjConfig struct {
NumSongsAlias string
NextSongAlias string
CurrentSongAlias string
SetCommentAlias string
SetCommentAlias string
KillAlias string
}
Permissions struct {
@ -56,7 +57,7 @@ type DjConfig struct {
AdminNumSongs bool
AdminNextSong bool
AdminCurrentSong bool
AdminSetComment bool
AdminSetComment bool
AdminKill bool
}
}