Sha256: 1a9ac17bdd1fa2ab37efc2afd9dfd6c47b47da142ceeb5ce5293d3d5cb99148d

Contents?: true

Size: 1.02 KB

Versions: 20

Compression:

Stored size: 1.02 KB

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:    <https://github.com/MarioRuiz/slack-smart-bot#bot-management|more info>
  # helpadmin: command_id: :pause_bot
  # helpadmin:
  def pause_bot(dest, from)
    save_stats(__method__)
    if is_admin?
      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
        @bots_created[@channel_id][:status] = :paused 
        update_bots_file()
        send_msg_channel config.master_channel, "Changed status on #{config.channel} to :paused"
      end
      save_status :off, :paused, 'The admin paused this bot'
    else
      respond "Only admin users can put me on pause", dest
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
slack-smart-bot-1.15.25 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.15.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.15.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.14.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/commands/on_bot/admin/pause_bot.rb