Added functionality to disable bot responding in disable channels

This commit is contained in:
Priit Heinsaar
2015-02-27 15:06:12 +02:00
parent edfbe6eec4
commit edd8a50629
3 changed files with 66 additions and 0 deletions

View File

@ -146,6 +146,20 @@ function is_sudo(msg)
return var
end
function is_disabled(msg)
local var = false
if msg.text == "!channel enable" then
return var
end
-- Check users id in config
for v,channel in pairs(_config.disabled_channels) do
if channel == msg.to.id then
var = true
end
end
return var
end
-- Returns the name of the sender
function get_name(msg)
local name = msg.from.first_name