- RSS für Kanäle! Fix #6

- ID kennzeichnet Chat-Admins und -Gründer
- table.contains() in utilites.lua verschoben
- Mehr Bindings: getChatInfo, getChatAdministrators
This commit is contained in:
Andreas Bielawski
2016-07-05 22:26:46 +02:00
parent 14215f52dd
commit 4eb46422b5
4 changed files with 112 additions and 40 deletions

View File

@ -175,6 +175,20 @@ function utilities:answer_callback_query(callback, text, show_alert)
} )
end
-- https://core.telegram.org/bots/api#getchat
function utilities:get_chat_info(chat_id)
return bindings.request(self, 'getChat', {
chat_id = chat_id
} )
end
-- https://core.telegram.org/bots/api#getchatadministrators
function utilities:get_chat_administrators(chat_id)
return bindings.request(self, 'getChatAdministrators', {
chat_id = chat_id
} )
end
-- get the indexed word in a string
function utilities.get_word(s, i)
s = s or ''
@ -865,4 +879,13 @@ function url_encode(str)
return str
end
function table.contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
return utilities