Sha256: f64f6a5d4a24f025bfb4efdb66114c6c4ca281ec5c73345b24349babea29b118

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

class SlackSmartBot

  # helpadmin: ----------------------------------------------
  # helpadmin: `pause bot`
  # helpadmin: `pause this bot`
  # helpadmin:    the bot will pause so it will listen only to admin commands
  # helpadmin:    You can use this command only if you are an admin user
  # helpadmin:
  def pause_bot(dest, from)
    if ADMIN_USERS.include?(from) #admin user
      respond "This bot is paused from now on. You can start it again: start this bot", dest
      respond "zZzzzzZzzzzZZZZZZzzzzzzzz", dest
      @status = :paused
      unless ON_MASTER_BOT
        send_msg_channel MASTER_CHANNEL, "Changed status on #{CHANNEL} to :paused"
      end
    else
      respond "Only admin users can put me on pause", dest
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slack-smart-bot-1.0.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.0.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.0.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb