diff --git a/bot/bot.lua b/bot/bot.lua index bf47b62..1cfad5d 100644 --- a/bot/bot.lua +++ b/bot/bot.lua @@ -103,25 +103,6 @@ function load_config() return config end -function is_sudo(msg) - local var = false - -- Check users id in config - for v,user in pairs(config.sudo_users) do - if user == msg.from.id then - var = true - end - end - return var -end - -function get_name(msg) - local name = msg.from.first_name - if name == nil then - name = msg.from.id - end - return name -end - function update_user_stats(msg) -- Save user to _users table local from_id = tostring(msg.from.id) diff --git a/bot/utils.lua b/bot/utils.lua index ea2b8b5..3f774b8 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -121,3 +121,22 @@ function run_command(str) cmd:close() return result end + +function is_sudo(msg) + local var = false + -- Check users id in config + for v,user in pairs(config.sudo_users) do + if user == msg.from.id then + var = true + end + end + return var +end + +function get_name(msg) + local name = msg.from.first_name + if name == nil then + name = msg.from.id + end + return name +end \ No newline at end of file