mirror of https://github.com/velour/catbase.git
bot: unroll args
This commit is contained in:
parent
f661d7dca2
commit
4b5b66dd6d
|
@ -29,7 +29,7 @@ func (b *bot) Receive(kind Kind, msg msg.Message, args ...interface{}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, name := range b.pluginOrdering {
|
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
|
goto RET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ RET:
|
||||||
func (b *bot) runCallback(plugin Plugin, evt Kind, message msg.Message, args ...interface{}) bool {
|
func (b *bot) runCallback(plugin Plugin, evt Kind, message msg.Message, args ...interface{}) bool {
|
||||||
t := reflect.TypeOf(plugin)
|
t := reflect.TypeOf(plugin)
|
||||||
for _, cb := range b.callbacks[t][evt] {
|
for _, cb := range b.callbacks[t][evt] {
|
||||||
if cb(evt, message, args) {
|
if cb(evt, message, args...) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue