def channel(id, server = nil)
      id = id.resolve_id

      raise Discordrb::Errors::NoPermission if @restricted_channels.include? id

      debug("Obtaining data for channel with id #{id}")
      return @channels[id] if @channels[id]

      begin
        begin
          response = API::Channel.resolve(token, id)
        rescue RestClient::ResourceNotFound
          return nil
        end
        channel = Channel.new(JSON.parse(response), self, server)
        @channels[id] = channel
      rescue Discordrb::Errors::NoPermission
        debug "Tried to get access to restricted channel #{id}, blacklisting it"
        @restricted_channels << id
        raise
      end
    end
def channel(id, server = nil)
      id = id.resolve_id

      raise Discordrb::Errors::NoPermission if @restricted_channels.include? id

      debug("Obtaining data for channel with id #{id}")
      return @channels[id] if @channels[id]

      begin
        begin
          response = API::Channel.resolve(token, id)
        rescue RestClient::ResourceNotFound
          return nil
        end
        channel = Channel.new(JSON.parse(response), self, server)
        @channels[id] = channel
      rescue Discordrb::Errors::NoPermission
        debug "Tried to get access to restricted channel #{id}, blacklisting it"
        @restricted_channels << id
        raise
      end
    end
Gets a channel given its ID. This queries the internal channel cache, and if the channel doesn't
 exist in there, it will get the data from Discord.
 @param id [Integer] The channel ID for which to search for.
 @param server [Server] The server for which to search the channel for. If this isn't specified, it will be
   inferred using the API
 @return [Channel] The channel identified by the ID.