id.help = '/id [chat] - Sends information about the given chat. Input is also accepted via reply. Only /user will display user statistics. Aliases: /user, /whoami.'
end
function id.resolve_chat(input, language, send_chat_action, current_group, show_user_stats, api_mode)
local output = {}
if not input then
return false
elseif send_chat_action and current_group then
mattata.send_chat_action(current_group, 'typing')
end
local success = mattata.get_user(input, false, true) or mattata.get_chat(input)
if not success or not success.result then
if api_mode then
return false
end
return language['id']['1']
end
if success.result.type == 'private' then
local name = success.result.first_name
if success.result.last_name then
name = name .. ' ' .. success.result.last_name
end
local nickname = redis:hget('user:' .. success.result.id .. ':info', 'nickname')