ID: Funktioniert jetzt auch inline
This commit is contained in:
parent
cbc72d8fe0
commit
b49088b9fe
@ -7,6 +7,11 @@ function id:init(config)
|
|||||||
"^/id$",
|
"^/id$",
|
||||||
"^/ids? (chat)$"
|
"^/ids? (chat)$"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
id.inline_triggers = {
|
||||||
|
"^id$"
|
||||||
|
}
|
||||||
|
|
||||||
id.doc = [[```
|
id.doc = [[```
|
||||||
Returns user and chat info for you or the replied-to message.
|
Returns user and chat info for you or the replied-to message.
|
||||||
Alias: ]]..config.cmd_pat..[[who
|
Alias: ]]..config.cmd_pat..[[who
|
||||||
@ -44,6 +49,14 @@ function id:get_user(user_id, chat_id)
|
|||||||
return user_info
|
return user_info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function id:inline_callback(inline_query, config, matches)
|
||||||
|
local id = tostring(inline_query.from.id)
|
||||||
|
local name = utilities.build_name(inline_query.from.first_name, inline_query.from.last_name)
|
||||||
|
|
||||||
|
local results = '[{"type":"article","id":"30","title":"Deine Telegram-ID ist:","description":"'..id..'","input_message_content":{"message_text":"<b>'..name..'</b>: <code>'..id..'</code>","parse_mode":"HTML"}}]'
|
||||||
|
utilities.answer_inline_query(self, inline_query, results, 10000)
|
||||||
|
end
|
||||||
|
|
||||||
function id:action(msg, config, matches)
|
function id:action(msg, config, matches)
|
||||||
|
|
||||||
if matches[1] == "/id" then
|
if matches[1] == "/id" then
|
||||||
|
Reference in New Issue
Block a user