Structures

The following structures are available globally.

  • Used to index into a DiscordLazyDictionary. Holds the index into the backing dictonary

    See more

    Declaration

    Swift

    public struct DiscordLazyDictionaryIndex<K: Hashable, V> : Comparable
  • A value-lazy dictionary

    To store a lazy value into the dictionary:

    var dict = [2: 4] as DiscordLazyDictionary
    
    dict[lazy: 24] = .lazy({ 2343 + 2343 })
    
    See more

    Declaration

    Swift

    public struct DiscordLazyDictionary<K: Hashable, V> : ExpressibleByDictionaryLiteral, Collection
  • The stored type of a Discord Snowflake ID

    See more

    Declaration

    Swift

    public struct Snowflake
  • A type that represents a Discord JWT.

    This type conforms to ExpressibleByStringLiteral so it can be created via string literals.

    For example:

    let token = "Bot adfadf.adfdafdafdfa.afdaf" as DiscordToken
    

    The Bot prefix indicates that this token is a bot. This must included if the token is for a bot. Likewise, if the token is an OAuth token, it must be preceded by Bearer. User tokens can omit a prefix.

    See more

    Declaration

    Swift

    public struct DiscordToken : ExpressibleByStringLiteral, CustomStringConvertible
  • Represents a gateway payload. This is lowest level of the Discord API.

    See more

    Declaration

    Swift

    public struct DiscordGatewayPayload : Encodable
  • Struct that represents shard information. Used when a client is doing manual sharding.

    See more

    Declaration

    Swift

    public struct DiscordShardInformation
  • An endpoint is made up of a REST api endpoint and any major parameters in that endpoint. Ex. /channels/232184444340011009/messages and /channels/186926276592795659/messages Are considered different endpoints

    See more

    Declaration

    Swift

    public struct DiscordRateLimitKey : Hashable
  • Represents a Discord Permission. Calculating Permissions involves bitwise operations.

    See more

    Declaration

    Swift

    public struct DiscordPermission : OptionSet, Encodable
  • Represents a permission overwrite for a channel.

    The allow and deny properties are bit fields.

    See more

    Declaration

    Swift

    public struct DiscordPermissionOverwrite : Encodable
  • Represents a Discord role.

    See more

    Declaration

    Swift

    public struct DiscordRole : Encodable, Equatable
  • A struct that contains a Discord voice packet with raw data.

    See more

    Declaration

    Swift

    public struct DiscordRawVoiceData
  • A struct that contains a Discord voice packet with Opus encoded data.

    See more

    Declaration

    Swift

    public struct DiscordOpusVoiceData