class SlackSmartBot
def set_maintenance(user, status, message)
save_stats(__method__)
if config.on_master_bot
if config.team_id_masters.include?("#{user.team_id}_#{user.name}") 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."
save_status :off, :maintenance_on, config.on_maintenance_message
else
config.on_maintenance = false
respond "From now on I won't be on maintenance. Everything is back to normal!"
save_status :on, :maintenance_off, config.on_maintenance_message
end
@config_log.on_maintenance = config.on_maintenance
file = File.open("#{config.path}/config_tmp.status", "w")
file.write @config_log.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