Bugfix für AFK (kritisch)
This commit is contained in:
Andreas Bielawski 2016-07-30 13:22:25 +02:00
parent 200ae9ace7
commit b235b95757
2 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,7 @@ local bindings -- Load Telegram bindings.
local utilities -- Load miscellaneous and cross-plugin functions. local utilities -- Load miscellaneous and cross-plugin functions.
local redis = (loadfile "./otouto/redis.lua")() local redis = (loadfile "./otouto/redis.lua")()
bot.version = '2.2.3.1' bot.version = '2.2.3.2'
function bot:init(config) -- The function run when the bot is started or reloaded. function bot:init(config) -- The function run when the bot is started or reloaded.

View File

@ -80,8 +80,7 @@ function afk:pre_process(msg, self)
local timestamp = redis:hget(hash, 'time') local timestamp = redis:hget(hash, 'time')
local current_timestamp = msg.date local current_timestamp = msg.date
local afk_time = current_timestamp - timestamp local afk_time = current_timestamp - timestamp
local seconds = afk_time % 60 local duration = makeHumanTime(afk_time)
local duration = makeHumanTime(seconds)
redis:hset(hash, 'afk', false) redis:hset(hash, 'afk', false)
if afk_text then if afk_text then