Protocols

The following protocols are available globally.

  • Declares that a type will be a delegate for a DiscordClient. After the client handles any events, the corresponding delegate method will be called.

    See more

    Declaration

    Swift

    public protocol DiscordClientDelegate : class
  • Declares that a type will act as a logger.

    See more

    Declaration

    Swift

    public protocol DiscordLogger
  • Declares that a type will have a Discord token.

    See more

    Declaration

    Swift

    public protocol DiscordTokenBearer
  • Declares that a type will be an Engine for the Discord Gateway.

    See more

    Declaration

    Swift

    public protocol DiscordEngineSpec : DiscordShard
  • Declares that a type will be capable of communicating with Discord’s WebSockets

    See more

    Declaration

    Swift

    public protocol DiscordWebSocketable : class
  • Protocol that declares a type will be a consumer of the Discord REST API. All requests through from a consumer should be rate limited.

    This is where a DiscordClient gets the methods that interact with the REST API.

    NOTE: Callbacks from the default implementations are NOT executed on the client’s handleQueue. So it is important that if you make modifications to the client inside of a callback, you first dispatch back on the handleQueue.

    See more

    Declaration

    Swift

    public protocol DiscordEndpointConsumer
  • A DiscordRateLimiterSpec is in charge of making sure we don’t flood Discord with requests. It keeps a dictionary of DiscordRateLimitKeys and DiscordRateLimits. All requests to the REST api should be routed through a DiscordRateLimiterSpec.

    See more

    Declaration

    Swift

    public protocol DiscordRateLimiterSpec
  • Declares that a type will act as a Discord user.

    See more

    Declaration

    Swift

    public protocol DiscordUserActor
  • Declares that a type has enough information to encode/decode Opus data.

    See more

    Declaration

    Swift

    public protocol DiscordOpusCodeable
  • Specifies that a type will be a data source for a VoiceEngine.

    See more

    Declaration

    Swift

    public protocol DiscordVoiceDataSource : class