From 8367c174592729abdd594d83c1ab9fad85f89b12 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Mon, 27 Jun 2016 15:44:11 +0200 Subject: [PATCH] =?UTF-8?q?-=20send=5Fmessage=20unterst=C3=BCtzt=20jetzt?= =?UTF-8?q?=20reply=5Fmarkup=20(Keyboards).=20Jaja,=20der=20Rest=20kommt?= =?UTF-8?q?=20auch=20noch=20-=20Meldung=20bzgl.=20callback=5Fquerys=20eing?= =?UTF-8?q?ebaut=20(wer=20einen=20Einsatzzweck=20f=C3=BCr=20diese=20hat,?= =?UTF-8?q?=20bitte=20melden,=20w=C3=BCrde=20das=20gerne=20implementieren!?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/bot.lua | 4 +++- otouto/utilities.lua | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/otouto/bot.lua b/otouto/bot.lua index 6ec117e..9378400 100644 --- a/otouto/bot.lua +++ b/otouto/bot.lua @@ -94,7 +94,9 @@ function bot:run(config) if res then for _,v in ipairs(res.result) do -- Go through every new message. self.last_update = v.update_id - if v.message then + if v.callback_query then + print('callback_query wird noch nicht unterstützt! Erhaltener Wert: '..v.callback_query.data) + elseif v.message then bot.on_msg_receive(self, v.message, config) end end diff --git a/otouto/utilities.lua b/otouto/utilities.lua index 9c71f66..62ed9f4 100644 --- a/otouto/utilities.lua +++ b/otouto/utilities.lua @@ -16,13 +16,14 @@ local mimetype = (loadfile "./otouto/mimetype.lua")() -- For the sake of ease to new contributors and familiarity to old contributors, -- we'll provide a couple of aliases to real bindings here. -function utilities:send_message(chat_id, text, disable_web_page_preview, reply_to_message_id, use_markdown) +function utilities:send_message(chat_id, text, disable_web_page_preview, reply_to_message_id, use_markdown, reply_markup) return bindings.request(self, 'sendMessage', { chat_id = chat_id, text = text, disable_web_page_preview = disable_web_page_preview, reply_to_message_id = reply_to_message_id, - parse_mode = use_markdown and 'Markdown' or nil + parse_mode = use_markdown and 'Markdown' or nil, + reply_markup = reply_markup } ) end