-
Notifications
You must be signed in to change notification settings - Fork 25
Discord Permission
Erik Little edited this page Oct 17, 2016
·
1 revision
Discord Permissions are represented by an enum, with each case having the corresponding permission value.
public enum DiscordPermission : Int {
case none
case createInstantInvite = 0x00000001
case kickMembers = 0x00000002
case banMembers = 0x00000004
case administrator = 0x00000008
case manageChannels = 0x00000010
case manageGuild = 0x00000020
case readMessages = 0x00000400
case sendMessages = 0x00000800
case sendTTSMessages = 0x00001000
case manageMessages = 0x00002000
case embedLinks = 0x00004000
case attachFiles = 0x00008000
case readMessageHistory = 0x00010000
case mentionEveryone = 0x00020000
case useExternalEmojis = 0x00040000
case connect = 0x00100000
case speak = 0x00200000
case muteMembers = 0x00400000
case deafenMembers = 0x00800000
case moveMembers = 0x01000000
case useVAD = 0x02000000
case changeNickname = 0x04000000
case manageNicknames = 0x08000000
case manageRoles = 0x10000000
}
The following operators are defined for DiscordPermission to make it easier to do bitwise math on them.
public func |(lhs: DiscordPermission, rhs: DiscordPermission) -> Int { }
public func &(lhs: DiscordPermission, rhs: DiscordPermission) -> Int { }
public func |(lhs: Int, rhs: DiscordPermission) -> Int { }
public func &(lhs: Int, rhs: DiscordPermission) -> Int { }
public func |=(lhs: inout Int, rhs: DiscordPermission) { }
public func &=(lhs: inout Int, rhs: DiscordPermission) { }