bot
bot copied to clipboard
Channel posts in webhook ProcessUpdate
Currently channel post are not properly processed in webhook.
func (b *Bot) ProcessUpdate(ctx context.Context, upd *models.Update) {
h := b.defaultHandlerFunc
defer func() {
applyMiddlewares(h, b.middlewares...)(ctx, b, upd)
}()
if upd.Message != nil {
h = b.findHandler(HandlerTypeMessageText, upd)
return
}
if upd.CallbackQuery != nil {
h = b.findHandler(HandlerTypeCallbackQueryData, upd)
return
}
}
This need to be updated as well as this:
// handlers.go
switch h.handlerType {
case HandlerTypeMessageText:
data = update.Message.Text
case HandlerTypeCallbackQueryData:
data = update.CallbackQuery.Data
}