- 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:
parent
195be96423
commit
8367c17459
@ -94,7 +94,9 @@ function bot:run(config)
|
|||||||
if res then
|
if res then
|
||||||
for _,v in ipairs(res.result) do -- Go through every new message.
|
for _,v in ipairs(res.result) do -- Go through every new message.
|
||||||
self.last_update = v.update_id
|
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)
|
bot.on_msg_receive(self, v.message, config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -16,13 +16,14 @@ local mimetype = (loadfile "./otouto/mimetype.lua")()
|
|||||||
|
|
||||||
-- For the sake of ease to new contributors and familiarity to old contributors,
|
-- For the sake of ease to new contributors and familiarity to old contributors,
|
||||||
-- we'll provide a couple of aliases to real bindings here.
|
-- 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', {
|
return bindings.request(self, 'sendMessage', {
|
||||||
chat_id = chat_id,
|
chat_id = chat_id,
|
||||||
text = text,
|
text = text,
|
||||||
disable_web_page_preview = disable_web_page_preview,
|
disable_web_page_preview = disable_web_page_preview,
|
||||||
reply_to_message_id = reply_to_message_id,
|
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
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user