mirror of https://github.com/velour/catbase.git
Fix bug with empty commands
This commit is contained in:
parent
72b71de10e
commit
88c2736f5a
|
@ -42,6 +42,10 @@ func (p *AdminPlugin) Message(message bot.Message) bool {
|
||||||
|
|
||||||
body := message.Body
|
body := message.Body
|
||||||
|
|
||||||
|
if len(body) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if body[0] == '$' {
|
if body[0] == '$' {
|
||||||
return p.handleVariables(message)
|
return p.handleVariables(message)
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,10 @@ func (p *DowntimePlugin) Message(message bot.Message) bool {
|
||||||
channel := message.Channel
|
channel := message.Channel
|
||||||
ret := false
|
ret := false
|
||||||
|
|
||||||
|
if len(parts) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if parts[0] == "idle" && len(parts) == 2 {
|
if parts[0] == "idle" && len(parts) == 2 {
|
||||||
nick := parts[1]
|
nick := parts[1]
|
||||||
// parts[1] must be the userid, or we don't know them
|
// parts[1] must be the userid, or we don't know them
|
||||||
|
|
Loading…
Reference in New Issue