【发布时间】:2016-07-28 15:41:21
【问题描述】:
您好,我的电报机器人有一些问题,它是用 ruby 开发的,带有 'telegrammer' 客户端。
1)
when '/lottery'
question = 'choose a number:'
answers =
Telegram::Bot::Types::ReplyKeyboardMarkup.new(
keyboard: [
["1", "2", "3"],
["4", "5", "6"],
["7", "8", "9"],
[" ", "0", " "]
],
one_time_keyboard: true
)
bot.api.sendMessage(chat_id: message.chat.id, text: question, reply_markup: answers)
我如何与用户的回答互动?喜欢
if answers == "1"
bot.api.sendMessage(chat_id: message.chat.id, text: "You have selected 1", reply_markup: answers)
end
2) 我怎样才能读到像
这样的命令/*** @user1
然后机器人会说
@user1 @user 告诉你***
提前非常感谢您...
【问题讨论】:
-
您找到解决方案了吗?
-
我不记得了,但我想不是,我停止了电报机器人的工作,抱歉
-
好的!没问题!目前我可以通过预定义内联键盘中的命令来解决问题,让用户自动选择它。
标签: ruby macos telegram telegram-bot