Closed MarioVilas closed 1 month ago
Line 34 contains this:
ChatID: update.Message.Chat.ID,
This is the entire function:
func handler(ctx context.Context, b *bot.Bot, update *models.Update) {
b.SendMessage(ctx, &bot.SendMessageParams{
ChatID: update.Message.Chat.ID,
Text: update.Message.Text,
})
}
You can use handler
func handler(ctx context.Context, b *bot.Bot, update *models.Update) {
if update.Message != nil {
b.SendMessage(ctx, &bot.SendMessageParams{
ChatID: update.Message.Chat.ID,
Text: update.Message.Text,
})
}
}
Simple examples don't cover all the ways a bot can be used
I tried the example bot from the documentation that just echoes back whatever you write (echo/main.go).
Then I added the bot to a group with myself and tried to talk to it in the group. This is the error I get:
Note that I get the same error whenever I run the bot since then. Probably because it's still trying to download the message that causes it to crash.