Sha256: e1587ae08b1e6be05f3ae8b00b5c5f0d5e7977746729b6181b8cc0173b268f2e

Contents?: true

Size: 935 Bytes

Versions: 6

Compression:

Stored size: 935 Bytes

Contents

class SlackSmartBot

  # help: ----------------------------------------------
  # help: `Hi Bot`
  # help: `Hi Smart`
  # help: `Hello Bot` `Hola Bot` `Hallo Bot` `What's up Bot` `Hey Bot` `Hæ Bot`
  # help: `Hello THE_NAME_OF_THE_BOT`
  # help:    Also apart of Hello you can use _Hallo, Hi, Hola, What's up, Hey, Hæ_
  # help:    Bot starts listening to you
  # help:    After that if you want to avoid a single message to be treated by the smart bot, start the message by -
  # help:
  def hi_bot(user, dest, dchannel, from, display_name)
    if @status == :on
      greetings = ["Hello", "Hallo", "Hi", "Hola", "What's up", "Hey", "Hæ"].sample
      respond "#{greetings} #{display_name}", dest
      if Thread.current[:using_channel]!=''
        respond "You are using specific rules for channel: <##{Thread.current[:using_channel]}>", dest
      end
      @listening << from unless @listening.include?(from)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slack-smart-bot-1.4.3 lib/slack/smart-bot/commands/general/hi_bot.rb
slack-smart-bot-1.4.2 lib/slack/smart-bot/commands/general/hi_bot.rb
slack-smart-bot-1.4.1 lib/slack/smart-bot/commands/general/hi_bot.rb
slack-smart-bot-1.4.0 lib/slack/smart-bot/commands/general/hi_bot.rb
slack-smart-bot-1.3.1 lib/slack/smart-bot/commands/general/hi_bot.rb
slack-smart-bot-1.3.0 lib/slack/smart-bot/commands/general/hi_bot.rb