package permissions // Permission bitflags. const ( VIEW_CHANNEL int64 = 1 << 0 SEND_MESSAGES int64 = 1 << 1 MANAGE_MESSAGES int64 = 1 << 2 KICK_MEMBERS int64 = 1 << 3 BAN_MEMBERS int64 = 1 << 4 MANAGE_SERVER int64 = 1 << 5 MANAGE_CHANNELS int64 = 1 << 6 ADMINISTRATOR int64 = 1 << 7 CONNECT_VOICE int64 = 1 << 8 SPEAK_VOICE int64 = 1 << 9 SHARE_SCREEN int64 = 1 << 10 ) // DefaultEveryonePermissions is granted to the @everyone role when a server is created. // Bits 0,1,8,9,10 = VIEW_CHANNEL | SEND_MESSAGES | CONNECT_VOICE | SPEAK_VOICE | SHARE_SCREEN = 1539. const DefaultEveryonePermissions int64 = VIEW_CHANNEL | SEND_MESSAGES | CONNECT_VOICE | SPEAK_VOICE | SHARE_SCREEN // Has reports whether the permission set contains the given permission bits. func Has(permissions int64, perm int64) bool { return permissions&perm == perm } // Add returns permissions with the given bits set. func Add(permissions int64, perm int64) int64 { return permissions | perm } // Remove returns permissions with the given bits cleared. func Remove(permissions int64, perm int64) int64 { return permissions &^ perm }