Sha256: aeeb8698c9a205c2355dc5724dcf5ccee4a49b63597ea35e9cf0ea3b758d9944

Contents?: true

Size: 1.33 KB

Versions: 17

Compression:

Stored size: 1.33 KB

Contents

class SlackSmartBot

  # helpadmin: ----------------------------------------------
  # helpadmin: `stop using rules on CHANNEL_NAME`
  # helpadmin:    it will stop using the extended rules on the specified channel.
  # helpadmin:

  def stop_using_rules_on(dest, user, from, channel, typem)
    save_stats(__method__)
    unless typem == :on_extended
      if !config.admins.include?(from) #not admin
        respond "Only admins can extend or stop using the rules. Admins on this channel: #{config.admins}", dest
      else
        get_bots_created()
        if @bots_created[@channel_id][:extended].include?(channel)
          @bots_created[@channel_id][:extended].delete(channel)
          update_bots_file()
          respond "<@#{user.id}> removed the access to the rules of #{config.channel} from #{channel}.", @master_bot_id
          if @channels_id[channel][0] == "G"
            respond "The rules won't be accessible from *#{channel}* from now on.", dest
          else
            respond "The rules won't be accessible from *<##{@channels_id[channel]}>* from now on.", dest
          end
          respond "<@#{user.id}> removed the access to the rules of <##{@channel_id}> from this channel.", @channels_id[channel]
        else
          respond "The rules were not accessible from *#{channel}*", dest
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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