lib/slack/smart-bot/treat_message.rb in slack-smart-bot-1.3.1 vs lib/slack/smart-bot/treat_message.rb in slack-smart-bot-1.4.0
- old
+ new
@@ -69,11 +69,10 @@
if dest[0] == "G" and config.on_master_bot and typem != :on_extended #private group
typem = :on_pg
end
end
end
-
unless typem == :dont_treat
begin
#todo: when changed @questions user_id then move user_info inside the ifs to avoid calling it when not necessary
user_info = client.web_client.users_info(user: data.user)
@@ -144,9 +143,25 @@
end
else
if !config.on_master_bot and !dest.nil? and (dest == @master_bot_id or dest[0] == "D") and
data.text.match?(/^\s*bot\s+status\s*$/i) and @admin_users_id.include?(data.user)
respond "ping from #{config.channel}", dest
+ elsif !config.on_master_bot and !dest.nil? and data.user == config[:nick_id] and dest == @master_bot_id
+ # to treat on other bots the status messages populated on master bot
+ case data.text
+ when /^Bot has been (closed|killed) by/i
+ sleep 2
+ get_bots_created()
+ when /^Changed status on (.+) to :(.+)/i
+ sleep 2
+ get_bots_created()
+ when /extended the rules from (.+) to be used on (.+)\.$/i
+ sleep 2
+ get_bots_created()
+ when /removed the access to the rules of (.+) from (.+)\.$/i
+ sleep 2
+ get_bots_created()
+ end
end
end
end
end