Implementation von Callback-Querys (auf ein neues!)
This commit is contained in:
@@ -52,11 +52,12 @@ end
|
||||
|
||||
-- NOTE: Telegram currently only allows file uploads up to 50 MB
|
||||
-- https://core.telegram.org/bots/api#sendphoto
|
||||
function utilities:send_photo(chat_id, file, text, reply_to_message_id)
|
||||
function utilities:send_photo(chat_id, file, text, reply_to_message_id, reply_markup)
|
||||
local output = bindings.request(self, 'sendPhoto', {
|
||||
chat_id = chat_id,
|
||||
caption = text or nil,
|
||||
reply_to_message_id = reply_to_message_id
|
||||
reply_to_message_id = reply_to_message_id,
|
||||
reply_markup = reply_markup
|
||||
}, {photo = file} )
|
||||
os.remove(file)
|
||||
print("Deleted: "..file)
|
||||
@@ -78,11 +79,12 @@ function utilities:send_audio(chat_id, file, reply_to_message_id, duration, perf
|
||||
end
|
||||
|
||||
-- https://core.telegram.org/bots/api#senddocument
|
||||
function utilities:send_document(chat_id, file, text, reply_to_message_id)
|
||||
function utilities:send_document(chat_id, file, text, reply_to_message_id, reply_markup)
|
||||
local output = bindings.request(self, 'sendDocument', {
|
||||
chat_id = chat_id,
|
||||
caption = text or nil,
|
||||
reply_to_message_id = reply_to_message_id
|
||||
reply_to_message_id = reply_to_message_id,
|
||||
reply_markup = reply_markup
|
||||
}, {document = file} )
|
||||
os.remove(file)
|
||||
print("Deleted: "..file)
|
||||
@@ -149,6 +151,15 @@ function utilities:send_typing(chat_id, action)
|
||||
} )
|
||||
end
|
||||
|
||||
-- https://core.telegram.org/bots/api#answercallbackquery
|
||||
function utilities:answer_callback_query(callback, text, show_alert)
|
||||
return bindings.request(self, 'answerCallbackQuery', {
|
||||
callback_query_id = callback.id,
|
||||
text = text,
|
||||
show_alert = show_alert
|
||||
} )
|
||||
end
|
||||
|
||||
-- get the indexed word in a string
|
||||
function utilities.get_word(s, i)
|
||||
s = s or ''
|
||||
@@ -775,4 +786,4 @@ function url_encode(str)
|
||||
return str
|
||||
end
|
||||
|
||||
return utilities
|
||||
return utilities
|
||||
Reference in New Issue
Block a user