DiscordPermission

public struct DiscordPermission : OptionSet, Encodable

Represents a Discord Permission. Calculating Permissions involves bitwise operations.

  • Declaration

    Swift

    public let rawValue: Int
  • This user can create invites.

    Declaration

    Swift

    public static let createInstantInvite = DiscordPermission(rawValue: 0x00000001)
  • This user can kick members.

    Declaration

    Swift

    public static let kickMembers = DiscordPermission(rawValue: 0x00000002)
  • This user can ban members.

    Declaration

    Swift

    public static let banMembers = DiscordPermission(rawValue: 0x00000004)
  • This user is an admin.

    Declaration

    Swift

    public static let administrator = DiscordPermission(rawValue: 0x00000008)
  • This user can manage channels.

    Declaration

    Swift

    public static let manageChannels = DiscordPermission(rawValue: 0x00000010)
  • This user can manage the guild.

    Declaration

    Swift

    public static let manageGuild = DiscordPermission(rawValue: 0x00000020)
  • This user can add reactions.

    Declaration

    Swift

    public static let addReactions = DiscordPermission(rawValue: 0x00000040)
  • This user can view the audit log.

    Declaration

    Swift

    public static let viewAuditLog = DiscordPermission(rawValue: 0x00000080)
  • This user can read messages.

    Declaration

    Swift

    public static let readMessages = DiscordPermission(rawValue: 0x00000400)
  • This user can send messages.

    Declaration

    Swift

    public static let sendMessages = DiscordPermission(rawValue: 0x00000800)
  • This user can send tts messages.

    Declaration

    Swift

    public static let sendTTSMessages = DiscordPermission(rawValue: 0x00001000)
  • This user can manage messages.

    Declaration

    Swift

    public static let manageMessages = DiscordPermission(rawValue: 0x00002000)
  • This user can embed links.

    Declaration

    Swift

    public static let embedLinks = DiscordPermission(rawValue: 0x00004000)
  • This user can attach files.

    Declaration

    Swift

    public static let attachFiles = DiscordPermission(rawValue: 0x00008000)
  • This user read the message history.

    Declaration

    Swift

    public static let readMessageHistory = DiscordPermission(rawValue: 0x00010000)
  • This user can mention everyone.

    Declaration

    Swift

    public static let mentionEveryone = DiscordPermission(rawValue: 0x00020000)
  • This user can can add external emojis.

    Declaration

    Swift

    public static let useExternalEmojis = DiscordPermission(rawValue: 0x00040000)
  • This user can connect to a voice channel.

    Declaration

    Swift

    public static let connect = DiscordPermission(rawValue: 0x00100000)
  • This user can speak on a voice channel.

    Declaration

    Swift

    public static let speak = DiscordPermission(rawValue: 0x00200000)
  • This user can mute members.

    Declaration

    Swift

    public static let muteMembers = DiscordPermission(rawValue: 0x00400000)
  • This user can deafen members.

    Declaration

    Swift

    public static let deafenMembers = DiscordPermission(rawValue: 0x00800000)
  • This user can move members.

    Declaration

    Swift

    public static let moveMembers = DiscordPermission(rawValue: 0x01000000)
  • This user can use VAD.

    Declaration

    Swift

    public static let useVAD = DiscordPermission(rawValue: 0x02000000)
  • This user can change their nickname.

    Declaration

    Swift

    public static let changeNickname = DiscordPermission(rawValue: 0x04000000)
  • This user can manage nicknames.

    Declaration

    Swift

    public static let manageNicknames = DiscordPermission(rawValue: 0x08000000)
  • This user can manage roles.

    Declaration

    Swift

    public static let manageRoles = DiscordPermission(rawValue: 0x10000000)
  • This user can manage WebHooks

    Declaration

    Swift

    public static let manageWebhooks = DiscordPermission(rawValue: 0x20000000)
  • This user can manage emojis

    Declaration

    Swift

    public static let manageEmojis = DiscordPermission(rawValue: 0x40000000)
  • All the channel permissions set to true.

    Declaration

    Swift

    public static let allChannel = DiscordPermission(rawValue: 0x33F7FC51)
  • All voice permissions set to true

    Declaration

    Swift

    public static let voice = DiscordPermission(rawValue: 0x3F00000)
  • all

    User has all permissions.

    Declaration

    Swift

    public static let all = DiscordPermission(rawValue: Int.max >> 10)
  • Declaration

    Swift

    public init(rawValue: Int)