Protocols
The following protocols are available globally.
-
Protocol that declares a type will be a Discord channel.
See moreDeclaration
Swift
public protocol DiscordChannel : DiscordClientHolder
-
Protocol that declares a type will be a Discord text-based channel.
See moreDeclaration
Swift
public protocol DiscordTextChannel : DiscordChannel
-
Declares that a type will be a delegate for a
See moreDiscordClient
. After the client handles any events, the corresponding delegate method will be called.Declaration
Swift
public protocol DiscordClientDelegate : class
-
Protocol that abstracts a DiscordClient
See moreDeclaration
Swift
public protocol DiscordClientSpec : DiscordVoiceManagerDelegate, DiscordShardManagerDelegate, DiscordUserActor
-
Declares that a type will be able to reference a DiscordClient from within itself.
See moreDeclaration
Swift
public protocol DiscordClientHolder
-
Declares that a type will act as a logger.
See moreDeclaration
Swift
public protocol DiscordLogger
-
Declares that a type will have a Discord token.
See moreDeclaration
Swift
public protocol DiscordTokenBearer
-
Protocol that declares a type will handle Discord dispatch events.
See moreDeclaration
Swift
public protocol DiscordDispatchEventHandler
-
Declares that a type will send heartbeats to a Discord gateway.
See moreDeclaration
Swift
public protocol DiscordEngineHeartbeatable
-
Declares that a type will be an Engine for the Discord Gateway.
See moreDeclaration
Swift
public protocol DiscordEngineSpec : DiscordShard
-
Declares that a type will be capable of communicating with Discord’s WebSockets
See moreDeclaration
Swift
public protocol DiscordWebSocketable : class
-
Declares that a type will communicate with a Discord gateway.
See moreDeclaration
Swift
public protocol DiscordGatewayable : DiscordEngineHeartbeatable
-
Protocol that represents a sharded gateway connection. This is the top-level protocol for
See moreDiscordEngineSpec
andDiscordEngine
Declaration
Swift
public protocol DiscordShard : DiscordWebSocketable, DiscordGatewayable
-
Declares that a type will be a shard’s delegate.
See moreDeclaration
Swift
public protocol DiscordShardDelegate : class, DiscordTokenBearer
-
The delegate for a
See moreDiscordShardManager
.Declaration
Swift
public protocol DiscordShardManagerDelegate : class, DiscordTokenBearer
-
Protocol that declares a type will be a Discord guild channel.
See moreDeclaration
Swift
public protocol DiscordGuildChannel : DiscordChannel
-
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 moreDeclaration
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 moreDeclaration
Swift
public protocol DiscordRateLimiterSpec
-
Declares that a type will act as a Discord user.
See moreDeclaration
Swift
public protocol DiscordUserActor
-
Declares that a type has enough information to encode/decode Opus data.
See moreDeclaration
Swift
public protocol DiscordOpusCodeable
-
Specifies that a type will be a data source for a VoiceEngine.
See moreDeclaration
Swift
public protocol DiscordVoiceDataSource : class
-
Declares that a type will be a voice engine.
See moreDeclaration
Swift
public protocol DiscordVoiceEngineSpec : DiscordWebSocketable, DiscordGatewayable
-
Declares that a type will be a client for a voice engine.
See moreDeclaration
Swift
public protocol DiscordVoiceEngineDelegate : class
-
A delegate for a VoiceManager.
See moreDeclaration
Swift
public protocol DiscordVoiceManagerDelegate : class, DiscordTokenBearer