Table key strings

This commit is contained in:
yago 2014-12-14 22:11:54 +01:00
parent e475659978
commit e8ac29d899
2 changed files with 5 additions and 3 deletions

View File

@ -33,10 +33,11 @@ function get_value(chat, value_name)
end end
function run(msg, matches) function run(msg, matches)
local chat_id = tostring(msg.to.id)
if matches[1] == "!get" then if matches[1] == "!get" then
return get_value(msg.to.id, nil) return get_value(chat_id, nil)
end end
return get_value(msg.to.id, matches[1]) return get_value(chat_id, matches[1])
end end
return { return {

View File

@ -17,7 +17,8 @@ function save_value(chat, text )
end end
function run(msg, matches) function run(msg, matches)
local text = save_value(msg.to.id, msg.text) local chat_id = tostring(msg.to.id)
local text = save_value(chat_id, msg.text)
return text return text
end end