Fix https://github.com/matthieugrieger/mumbledj/issues/37: Images in text messages crashing bot
This commit is contained in:
parent
e251b0ccda
commit
16572caad9
|
@ -3,6 +3,7 @@ MumbleDJ Changelog
|
|||
|
||||
### February 9, 2015 -- `v2.4.3`
|
||||
* Added configuration option in `mumbledj.gcfg` for default bot comment.
|
||||
* Fixed text messages only containing images crashing the bot.
|
||||
|
||||
### February 7, 2015 -- `v2.4.2`
|
||||
* Updated `gumble` and `gumbleutil` dependencies.
|
||||
|
|
6
main.go
6
main.go
|
@ -72,8 +72,10 @@ func (dj *mumbledj) OnDisconnect(e *gumble.DisconnectEvent) {
|
|||
// the incoming message otherwise.
|
||||
func (dj *mumbledj) OnTextMessage(e *gumble.TextMessageEvent) {
|
||||
plainMessage := gumbleutil.PlainText(&e.TextMessage)
|
||||
if plainMessage[0] == dj.conf.General.CommandPrefix[0] && plainMessage != dj.conf.General.CommandPrefix {
|
||||
parseCommand(e.Sender, e.Sender.Name(), plainMessage[1:])
|
||||
if len(plainMessage) != 0 {
|
||||
if plainMessage[0] == dj.conf.General.CommandPrefix[0] && plainMessage != dj.conf.General.CommandPrefix {
|
||||
parseCommand(e.Sender, e.Sender.Name(), plainMessage[1:])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue