bot: make plugins run async

This commit is contained in:
cws 2017-06-28 09:18:41 -04:00
parent f30955cdef
commit a602917008
1 changed files with 7 additions and 5 deletions

View File

@ -29,12 +29,14 @@ func (b *bot) MsgReceived(msg msg.Message) {
goto RET
}
for _, name := range b.pluginOrdering {
p := b.plugins[name]
if p.Message(msg) {
break
go (func() {
for _, name := range b.pluginOrdering {
p := b.plugins[name]
if p.Message(msg) {
break
}
}
}
})()
RET:
b.logIn <- msg