Method: Codebot::Integration#delete_channels!

Defined in:
lib/codebot/integration.rb

#delete_channels!(identifiers) ⇒ Object

Note:

This method is not thread-safe and should only be called from an active transaction.

Deletes the specified channels from this integration.

Parameters:

  • identifiers (Array<String>)

    the channel identifiers to remove

Raises:

  • (CommandError)

    if one of the channel identifiers does not exist



77
78
79
80
81
82
83
84
85
86
# File 'lib/codebot/integration.rb', line 77

def delete_channels!(identifiers)
  identifiers.each do |identifier|
    channel = @channels.find { |chan| chan.identifier_eql? identifier }
    if channel.nil?
      raise CommandError, "channel #{identifier.inspect} does not exist"
    end

    @channels.delete channel
  end
end