- send_message unterstützt jetzt reply_markup (Keyboards). Jaja, der Rest kommt auch noch

- Meldung bzgl. callback_querys eingebaut (wer einen Einsatzzweck für diese hat, bitte melden, würde das gerne implementieren!)
This commit is contained in:
Andreas Bielawski 2016-06-27 15:44:11 +02:00
parent 195be96423
commit 8367c17459
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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