class SlackSmartBot
def set_maintenance(from, status, message)
save_stats(__method__)
if config.on_master_bot
if config.admins.include?(from) if message == ''
config.on_maintenance_message = "Sorry I'm on maintenance so I cannot attend your request."
else
config.on_maintenance_message = message
end
if status == 'on'
config.on_maintenance = true
respond "From now on I'll be on maintenance status so I won't be responding accordingly."
else
config.on_maintenance = false
respond "From now on I won't be on maintenance. Everything is back to normal!"
end
file = File.open("#{config.path}/config_tmp.status", "w")
file.write config.inspect
file.close
else
respond 'Only master admins on master channel can use this command.'
end
else
respond 'Only master admins on master channel can use this command.'
end
end
end