Closed glebkin closed 4 months ago
For handle any updates, you can implement your logic in DefaultHandler
opts := []bot.Option{
bot.WithDefaultHandler(handler),
}
b, err := bot.New(os.Getenv("EXAMPLE_TELEGRAM_BOT_TOKEN"), opts...)
...
func handler(ctx context.Context, b *bot.Bot, update *models.Update) {
if update.Message != nil {
// handle message
return
}
// ...
if update.Poll != nil {
// handle poll
}
// etc...
}
Released in #65
Currently, there's no way to handle updates, which does not contain Message or CallbackQuery:
Which is actually a problem, because you can't for example handle channel post updates.