I'm writing a telegram bot in golang using github.com/Syfaro/telegram-bot-api. And I need following:
- A user sends a command
- Bot asks the user a question
- The user answers
- Then bot does some calculations and sends an answer
I can't find how to send the user an input request. Can anyone, please, help me with it?
updates := bot.ListenForWebhook("/" + bot.Token)
for update := range updates {
chatID := update.Message.Chat.ID
if update.Message.IsCommand() {
msg := tgbotapi.NewMessage(chatID, "")
switch update.Message.Command() {
case "command":
response := tgbotapi.inputRequest(chatId, "Enter some text:") //pseudocode
msg.Text = response.Text //
bot.Send(msg) //
}
} else {
bot.Send(tgbotapi.NewMessage(chatID, "I don't know what to say"))
}
}