Sha256: 723fc11eac58be0875511d0e420b959f8251fd94d0ba3c7477687675a56b3d01

Contents?: true

Size: 855 Bytes

Versions: 15

Compression:

Stored size: 855 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)
    save_stats(__method__)
    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
      @bots_created[@channel_id][: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

15 entries across 15 versions & 1 rubygems

Version Path
slack-smart-bot-1.8.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.8.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.8.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.7.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.8 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.7 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.6 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.5 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.4 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.3 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.6.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.5.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.5.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb