lib/slack/smart-bot/comm/event_hello.rb in slack-smart-bot-1.13.0 vs lib/slack/smart-bot/comm/event_hello.rb in slack-smart-bot-1.13.1

- old
+ new

@@ -1,7 +1,8 @@ class SlackSmartBot def event_hello() + @first_time_bot_started ||= true unless config.simulate m = "Successfully connected, welcome '#{client.self.name}' to the '#{client.team.name}' team at https://#{client.team.domain}.slack.com." puts m save_status :on, :connected, m @@ -16,11 +17,11 @@ version_message = "" if Gem::Version.new(version_remote) > Gem::Version.new(VERSION) version_message = ". There is a new available version: #{version_remote}." end if (!config[:silent] or ENV['BOT_SILENT'].to_s == 'false') and !config.simulate - unless ENV['BOT_SILENT']=='true' + unless ENV['BOT_SILENT']=='true' or !@first_time_bot_started respond "Smart Bot started v#{VERSION}#{version_message}\nIf you want to know what I can do for you: `bot help`.\n`bot rules` if you want to display just the specific rules of this channel.\nYou can talk to me privately if you prefer it." end ENV['BOT_SILENT'] = 'true' if config[:silent] and ENV['BOT_SILENT'].to_s != 'true' end @routines.each do |ch, rout| @@ -28,7 +29,8 @@ if !v[:running] and v[:channel_name] == config.channel create_routine_thread(k, v) end end end + @first_time_bot_started = false end end \ No newline at end of file