- AFK: Antworte nur, wenn Keyboard aktiv ist
- Post_Photo: send_typing
This commit is contained in:
parent
83e5f4a85e
commit
3740ccc497
@ -68,7 +68,7 @@ function afk:pre_process(msg, self)
|
|||||||
local user_id = msg.from.id
|
local user_id = msg.from.id
|
||||||
local chat_id = msg.chat.id
|
local chat_id = msg.chat.id
|
||||||
local hash = 'afk:'..chat_id..':'..user_id
|
local hash = 'afk:'..chat_id..':'..user_id
|
||||||
|
local uhash = 'user:'..user_id
|
||||||
|
|
||||||
if afk:is_offline(hash) then
|
if afk:is_offline(hash) then
|
||||||
local afk_text = afk:get_afk_text(hash)
|
local afk_text = afk:get_afk_text(hash)
|
||||||
@ -80,11 +80,20 @@ function afk:pre_process(msg, self)
|
|||||||
local duration = makeHumanTime(afk_time)
|
local duration = makeHumanTime(afk_time)
|
||||||
|
|
||||||
redis:hset(hash, 'afk', false)
|
redis:hset(hash, 'afk', false)
|
||||||
|
local show_afk_keyboard = redis:hget(uhash, 'afk_keyboard')
|
||||||
if afk_text then
|
if afk_text then
|
||||||
redis:hset(hash, 'afk_text', false)
|
redis:hset(hash, 'afk_text', false)
|
||||||
utilities.send_reply(self, msg, user_name..' ist wieder da (war: <b>'..afk_text..'</b> für '..duration..')!', 'HTML', '{"hide_keyboard":true,"selective":true}')
|
if show_afk_keyboard == 'true' then
|
||||||
|
utilities.send_reply(self, msg, user_name..' ist wieder da (war: <b>'..afk_text..'</b> für '..duration..')!', 'HTML', '{"hide_keyboard":true,"selective":true}')
|
||||||
|
else
|
||||||
|
utilities.send_message(self, chat_id, user_name..' ist wieder da (war: <b>'..afk_text..'</b> für '..duration..')!', true, nil, 'HTML')
|
||||||
|
end
|
||||||
else
|
else
|
||||||
utilities.send_reply(self, msg, user_name..' ist wieder da (war '..duration..' weg)!', nil, '{"hide_keyboard":true,"selective":true}')
|
if show_afk_keyboard == 'true' then
|
||||||
|
utilities.send_reply(self, msg, user_name..' ist wieder da (war '..duration..' weg)!', nil, '{"hide_keyboard":true,"selective":true}')
|
||||||
|
else
|
||||||
|
utilities.send_message(self, chat_id, user_name..' ist wieder da (war '..duration..' weg)!')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ function post_photo:pre_process(msg, self, config)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
utilities.send_typing(self, msg.chat.id, 'upload_photo')
|
||||||
-- Saving file to the Telegram Cloud
|
-- Saving file to the Telegram Cloud
|
||||||
local request = bindings.request(self, 'getFile', {
|
local request = bindings.request(self, 'getFile', {
|
||||||
file_id = file_id
|
file_id = file_id
|
||||||
|
Reference in New Issue
Block a user