Sha256: 289ecdbf9f64a4dcb389ba3d45f5c2e237ced4d45666c3a6079c146c911c7728

Contents?: true

Size: 776 Bytes

Versions: 6

Compression:

Stored size: 776 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 config.admins.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 config.on_master_bot
        send_msg_channel config.master_channel, "Changed status on #{config.channel} to :paused"
      end
    else
      respond "Only admin users can put me on pause", dest
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slack-smart-bot-1.3.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.3.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.2.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.1.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.1.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.1.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb