From e8ac29d8996527734e29b3c83893eabf20b5670a Mon Sep 17 00:00:00 2001 From: yago Date: Sun, 14 Dec 2014 22:11:54 +0100 Subject: [PATCH] Table key strings --- plugins/get.lua | 5 +++-- plugins/set.lua | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/get.lua b/plugins/get.lua index 625faa3..d9bad27 100644 --- a/plugins/get.lua +++ b/plugins/get.lua @@ -33,10 +33,11 @@ function get_value(chat, value_name) end function run(msg, matches) + local chat_id = tostring(msg.to.id) if matches[1] == "!get" then - return get_value(msg.to.id, nil) + return get_value(chat_id, nil) end - return get_value(msg.to.id, matches[1]) + return get_value(chat_id, matches[1]) end return { diff --git a/plugins/set.lua b/plugins/set.lua index 05fbccb..c706f98 100644 --- a/plugins/set.lua +++ b/plugins/set.lua @@ -17,7 +17,8 @@ function save_value(chat, text ) end 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 end