Closed wmw-lv closed 1 year ago
Hello. Custom handlers made for automatic text matching checks. For example, Update.Message.Text or Update.CallbackQuery.Data. Voice is a part of a Message. You can use this example
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
opts := []bot.Option{
bot.WithDefaultHandler(handler),
}
b, _ := bot.New(os.Getenv("EXAMPLE_TELEGRAM_BOT_TOKEN"), opts...)
b.Start(ctx)
}
func handler(ctx context.Context, b *bot.Bot, update *models.Update) {
if update.Message != nil && update.Message.Voice != nil {
// handle voice message
return
}
}
Will this solve your issue?
Hello, thank you very much for your response. It wasn't quite an issue, it was a suggestion. And yes, your previous comment solve this for sure.
Do you consider adding HandlerTypeVoiceMessage to Types?