Struct GuildPermissions
- Namespace
- Kook
- Assembly
- Kook.Net.Core.dll
Represents a set of permissions for a guild.
public struct GuildPermissions
- Inherited Members
Constructors
GuildPermissions(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool)
Creates a new GuildPermissions structure with the provided permissions.
public GuildPermissions(bool administrator = false, bool manageGuild = false, bool viewAuditLog = false, bool createInvites = false, bool manageInvites = false, bool manageChannels = false, bool kickMembers = false, bool banMembers = false, bool manageEmojis = false, bool changeNickname = false, bool manageRoles = false, bool viewChannel = false, bool sendMessages = false, bool manageMessages = false, bool attachFiles = false, bool connect = false, bool manageVoice = false, bool mentionEveryone = false, bool addReactions = false, bool followReactions = false, bool passiveConnect = false, bool onlyPushToTalk = false, bool useVoiceActivity = false, bool speak = false, bool deafenMembers = false, bool muteMembers = false, bool manageNicknames = false, bool playSoundtrack = false, bool shareScreen = false)
Parameters
administrator
boolmanageGuild
boolviewAuditLog
boolcreateInvites
boolmanageInvites
boolmanageChannels
boolkickMembers
boolbanMembers
boolmanageEmojis
boolchangeNickname
boolmanageRoles
boolviewChannel
boolsendMessages
boolmanageMessages
boolattachFiles
boolconnect
boolmanageVoice
boolmentionEveryone
booladdReactions
boolfollowReactions
boolpassiveConnect
boolonlyPushToTalk
booluseVoiceActivity
boolspeak
booldeafenMembers
boolmuteMembers
boolmanageNicknames
boolplaySoundtrack
boolshareScreen
bool
GuildPermissions(string)
Creates a new GuildPermissions with the provided packed value after converting to ulong.
public GuildPermissions(string rawValue)
Parameters
rawValue
string
GuildPermissions(ulong)
Creates a new GuildPermissions with the provided packed value.
public GuildPermissions(ulong rawValue)
Parameters
rawValue
ulong
Fields
All
Gets a GuildPermissions that grants all guild permissions.
public static readonly GuildPermissions All
Field Value
None
Gets a blank GuildPermissions that grants no permissions.
public static readonly GuildPermissions None
Field Value
Properties
AddReactions
If true
, a user may add reactions.
public bool AddReactions { get; }
Property Value
Administrator
If true
, a user is granted all permissions, and cannot have them revoked via channel permissions.
public bool Administrator { get; }
Property Value
AttachFiles
If true
, a user may send files.
public bool AttachFiles { get; }
Property Value
BanMembers
If true
, a user may ban users from the guild.
public bool BanMembers { get; }
Property Value
ChangeNickname
If true
, a user may change their own nickname.
public bool ChangeNickname { get; }
Property Value
Connect
If true
, a user may connect to a voice channel.
public bool Connect { get; }
Property Value
CreateInvites
If true
, a user may create invites.
public bool CreateInvites { get; }
Property Value
DeafenMembers
If true
, a user may deafen users.
public bool DeafenMembers { get; }
Property Value
FollowReactions
If true
, a user may follow added reactions.
public bool FollowReactions { get; }
Property Value
KickMembers
If true
, a user may kick users from the guild.
public bool KickMembers { get; }
Property Value
ManageChannels
If true
, a user may create, delete and modify channels.
public bool ManageChannels { get; }
Property Value
ManageEmojis
If true
, a user may edit the emojis for this guild.
public bool ManageEmojis { get; }
Property Value
ManageGuild
If true
, a user may adjust guild properties.
public bool ManageGuild { get; }
Property Value
ManageInvites
If true
, a user may view and revoke invites.
public bool ManageInvites { get; }
Property Value
ManageMessages
If true
, a user may delete messages.
public bool ManageMessages { get; }
Property Value
ManageNicknames
If true
, a user may change the nickname of other users.
public bool ManageNicknames { get; }
Property Value
ManageRoles
If true
, a user may adjust roles.
public bool ManageRoles { get; }
Property Value
ManageVoice
If true
, a user may kick other users from voice channels, and move other users between voice channels.
public bool ManageVoice { get; }
Property Value
MentionEveryone
If true
, a user may mention all users.
public bool MentionEveryone { get; }
Property Value
MuteMembers
If true
, a user may mute users.
public bool MuteMembers { get; }
Property Value
OnlyPushToTalk
If true
, a user may speak only via push-to-talk.
public bool OnlyPushToTalk { get; }
Property Value
PassiveConnect
If true
, a user may connect to a voice channel only when the user is invited or moved by other users.
public bool PassiveConnect { get; }
Property Value
PlaySoundtrack
If true
, a user may play soundtracks in a voice channel.
public bool PlaySoundtrack { get; }
Property Value
RawValue
Gets a packed value representing all the permissions in this GuildPermissions.
public readonly ulong RawValue { get; }
Property Value
SendMessages
If true
, a user may send messages.
public bool SendMessages { get; }
Property Value
ShareScreen
If true
, a user may share screen in a voice channel.
public bool ShareScreen { get; }
Property Value
Speak
If true
, a user may speak in a voice channel.
public bool Speak { get; }
Property Value
UseVoiceActivity
If true
, a user may use voice activation.
public bool UseVoiceActivity { get; }
Property Value
ViewAuditLog
If true
, a user may view the audit log.
public bool ViewAuditLog { get; }
Property Value
ViewChannel
If true
, a user may view channels.
public bool ViewChannel { get; }
Property Value
Methods
Has(GuildPermission)
Returns a value that indicates if a specific GuildPermission is enabled in these permissions.
public bool Has(GuildPermission permission)
Parameters
permission
GuildPermissionThe permission value to check for.
Returns
- bool
true
if the permission is enabled,false
otherwise.
Modify(bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)
Creates a new GuildPermissions from this one, changing the provided non-null permissions.
public GuildPermissions Modify(bool? administrator = null, bool? manageGuild = null, bool? viewAuditLog = null, bool? createInvites = null, bool? manageInvites = null, bool? manageChannels = null, bool? kickMembers = null, bool? banMembers = null, bool? manageEmojis = null, bool? changeNickname = null, bool? manageRoles = null, bool? viewChannel = null, bool? sendMessages = null, bool? manageMessages = null, bool? attachFiles = null, bool? connect = null, bool? manageVoice = null, bool? mentionEveryone = null, bool? addReactions = null, bool? followReactions = null, bool? passiveConnect = null, bool? onlyPushToTalk = null, bool? useVoiceActivity = null, bool? speak = null, bool? deafenMembers = null, bool? muteMembers = null, bool? manageNicknames = null, bool? playSoundtrack = null, bool? shareScreen = null)
Parameters
administrator
bool?manageGuild
bool?viewAuditLog
bool?createInvites
bool?manageInvites
bool?manageChannels
bool?kickMembers
bool?banMembers
bool?manageEmojis
bool?changeNickname
bool?manageRoles
bool?viewChannel
bool?sendMessages
bool?manageMessages
bool?attachFiles
bool?connect
bool?manageVoice
bool?mentionEveryone
bool?addReactions
bool?followReactions
bool?passiveConnect
bool?onlyPushToTalk
bool?useVoiceActivity
bool?speak
bool?deafenMembers
bool?muteMembers
bool?manageNicknames
bool?playSoundtrack
bool?shareScreen
bool?
Returns
ToList()
Returns a List<T> containing all of the GuildPermission flags that are enabled.
public List<GuildPermission> ToList()
Returns
- List<GuildPermission>
A List<T> containing GuildPermission flags. Empty if none are enabled.
ToString()
Gets the raw value of the permissions.
public override string ToString()