Sha256: 75b7cb917e17ee106b60f73f6cc0c80d478ffb7792993a7a1466e52f4fda954b

Contents?: true

Size: 817 Bytes

Versions: 13

Compression:

Stored size: 817 Bytes

Contents

class SlackSmartBot

  # help: ----------------------------------------------
  # help: `Bye Bot`
  # help: `Bye Smart`
  # help: `Bye NAME_OF_THE_BOT`
  # help:    Also apart of Bye you can use _Bæ, Good Bye, Adiós, Ciao, Bless, Bless Bless, Adeu_
  # help:    Bot stops listening to you
  # help:
  def bye_bot(dest, from, display_name)
    if @status == :on
      save_stats(__method__)
      bye = ["Bye", "Bæ", "Good Bye", "Adiós", "Ciao", "Bless", "Bless bless", "Adeu"].sample
      respond "#{bye} #{display_name}", dest

      if @listening.key?(from)
        if Thread.current[:on_thread]
          @listening[from].delete(Thread.current[:thread_ts])
        else
          @listening[from].delete(dest)
        end
        @listening.delete(from) if @listening[from].empty?
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
slack-smart-bot-1.8.2 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.8.1 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.8.0 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.7.0 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.8 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.7 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.6 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.5 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.4 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.3 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.2 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.1 lib/slack/smart-bot/commands/general/bye_bot.rb
slack-smart-bot-1.6.0 lib/slack/smart-bot/commands/general/bye_bot.rb