1
Telgraf bana ["ok" => true, "result" => true} ve hatta "düğmesi" düğmesi geri dönüyor PM'ye ", ancak cevapların sonucu olarak hiçbir şey görünmez. Burada bakış açımdan kırılabilecek tek şey, gönderilecek sonuçların dizisini hazırladığım yoldur. Biri bana yardım edebilir mi?Telegram bot 2.0 için ruby inline bot oluşturmaya çalışıyorum ama satır içi sonucunda hiçbir şey gösterilmiyorum
Telegram::Bot::Client.run(token) do |bot|
bot.listen do |message|
case message
when Telegram::Bot::Types::Message
puts "Message @#{message.from.username}: #{message.text}"
bot.api.send_message(chat_id: message.chat.id, text: "I am only inline bot for now")
when Telegram::Bot::Types::InlineQuery
puts " InlineQuery @#{message.from.username}: #{message.query} and #{message.id}"
results = [ JSON.parse('{"type":"article", "id":"0", "title":"Cool Blog", "message_text":"I am the author of this bot, please visit my blog"}'), JSON.parse('{"type":"article", "id":"1", "title":"Cool Blog", "message_text":"I am the author of this bot, please visit my blog"}')]
puts bot.api.answer_inline_query(inline_query_id: message.id, results: results, switch_pm_text:"PM me please", cache_time: 86400)
end
end
end