plugin middlewares; v0.3.10
This commit is contained in:
@@ -39,6 +39,9 @@ func (b *Bot) handleMessage(update *Update, ctx *MsgContext) {
|
||||
ctx.Text = strings.TrimSpace(text[len(cmd):])
|
||||
ctx.Args = strings.Split(ctx.Text, " ")
|
||||
|
||||
if !plugin.executeMiddlewares(ctx, b.dbContext) {
|
||||
return
|
||||
}
|
||||
go plugin.Execute(cmd, ctx, b.dbContext)
|
||||
return
|
||||
}
|
||||
@@ -65,6 +68,10 @@ func (b *Bot) handleCallback(update *Update, ctx *MsgContext) {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if !plugin.executeMiddlewares(ctx, b.dbContext) {
|
||||
return
|
||||
}
|
||||
go plugin.ExecutePayload(data.Command, ctx, b.dbContext)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user