-- Get timer data with TTL information
-- KEYS[1]: Timer key
-- ARGV[1]: Current timestamp

local timer_key = KEYS[1]
local current_time = tonumber(ARGV[1])

-- Get timer data and TTL
local timer_data = redis.call('GET', timer_key)
local ttl = redis.call('TTL', timer_key)

if not timer_data then
    return nil
end

-- Calculate remaining time
local remaining_seconds = ttl > 0 and ttl or 0

-- Return timer data with TTL information
return {timer_data, remaining_seconds, current_time}