bot: unroll args

This commit is contained in:
Chris Sexton 2019-02-05 15:24:49 -05:00
parent f661d7dca2
commit 4b5b66dd6d
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ func (b *bot) Receive(kind Kind, msg msg.Message, args ...interface{}) {
}
for _, name := range b.pluginOrdering {
if b.runCallback(b.plugins[name], kind, msg, args) {
if b.runCallback(b.plugins[name], kind, msg, args...) {
goto RET
}
}
@ -42,7 +42,7 @@ RET:
func (b *bot) runCallback(plugin Plugin, evt Kind, message msg.Message, args ...interface{}) bool {
t := reflect.TypeOf(plugin)
for _, cb := range b.callbacks[t][evt] {
if cb(evt, message, args) {
if cb(evt, message, args...) {
return true
}
}