Table of Contents

Struct ChannelPermissions

Namespace
Kook
Assembly
Kook.Net.Core.dll

Represents a set of permissions for a channel.

public struct ChannelPermissions
Inherited Members

Constructors

ChannelPermissions(bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)

Creates a new ChannelPermissions with the provided permissions.

public ChannelPermissions(bool? createInvites = false, bool? manageChannels = 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? passiveConnect = false, bool? useVoiceActivity = false, bool? speak = false, bool? deafenMembers = false, bool? muteMembers = false, bool? playSoundtrack = false, bool? shareScreen = false)

Parameters

createInvites bool?
manageChannels bool?
manageRoles bool?
viewChannel bool?
sendMessages bool?
manageMessages bool?
attachFiles bool?
connect bool?
manageVoice bool?
mentionEveryone bool?
addReactions bool?
passiveConnect bool?
useVoiceActivity bool?
speak bool?
deafenMembers bool?
muteMembers bool?
playSoundtrack bool?
shareScreen bool?

ChannelPermissions(ulong)

Creates a new ChannelPermissions with the provided packed value.

public ChannelPermissions(ulong rawValue)

Parameters

rawValue ulong

Fields

Category

Gets a ChannelPermissions that grants all permissions for category channels.

public static readonly ChannelPermissions Category

Field Value

ChannelPermissions

DM

Gets a ChannelPermissions that grants all permissions for direct message channels.

public static readonly ChannelPermissions DM

Field Value

ChannelPermissions

None

Gets a blank ChannelPermissions that grants no permissions.

public static readonly ChannelPermissions None

Field Value

ChannelPermissions

Text

Gets a ChannelPermissions that grants all permissions for text channels.

public static readonly ChannelPermissions Text

Field Value

ChannelPermissions

Voice

Gets a ChannelPermissions that grants all permissions for voice channels.

public static readonly ChannelPermissions Voice

Field Value

ChannelPermissions

Properties

AddReactions

If true, a user may add reactions.

public bool AddReactions { get; }

Property Value

bool

AttachFiles

If true, a user may send files.

public bool AttachFiles { get; }

Property Value

bool

Connect

If true, a user may connect to a voice channel.

public bool Connect { get; }

Property Value

bool

CreateInvites

If true, a user may create invites.

public bool CreateInvites { get; }

Property Value

bool

DeafenMembers

If true, a user may deafen users.

public bool DeafenMembers { get; }

Property Value

bool

ManageChannels

If true, a user may view and revoke invites.

public bool ManageChannels { get; }

Property Value

bool

ManageMessages

If true, a user may delete messages.

public bool ManageMessages { get; }

Property Value

bool

ManageRoles

If true, a user may adjust roles.

public bool ManageRoles { get; }

Property Value

bool

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

bool

MentionEveryone

If true, a user may mention all users.

public bool MentionEveryone { get; }

Property Value

bool

MuteMembers

If true, a user may mute users.

public bool MuteMembers { get; }

Property Value

bool

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

bool

PlaySoundtrack

If true, a user may play soundtracks in a voice channel.

public bool PlaySoundtrack { get; }

Property Value

bool

RawValue

Gets a packed value representing all the permissions in this ChannelPermissions.

public readonly ulong RawValue { get; }

Property Value

ulong

SendMessages

If true, a user may send messages.

public bool SendMessages { get; }

Property Value

bool

ShareScreen

If true, a user may share screen in a voice channel.

public bool ShareScreen { get; }

Property Value

bool

Speak

If true, a user may speak in a voice channel.

public bool Speak { get; }

Property Value

bool

UseVoiceActivity

If true, a user may use voice activation.

public bool UseVoiceActivity { get; }

Property Value

bool

ViewChannel

If true, a user may view channels.

public bool ViewChannel { get; }

Property Value

bool

Methods

All(IChannel)

Gets a ChannelPermissions that grants all permissions for a given channel type.

public static ChannelPermissions All(IChannel channel)

Parameters

channel IChannel

Returns

ChannelPermissions

Exceptions

ArgumentException

Unknown channel type.

Has(ChannelPermission)

Returns a value that indicates if a specific ChannelPermission is enabled in these permissions.

public bool Has(ChannelPermission permission)

Parameters

permission ChannelPermission

The 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?)

Creates a new ChannelPermissions from this one, changing the provided non-null permissions.

public ChannelPermissions Modify(bool? createInvites = null, bool? manageChannels = 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? passiveConnect = null, bool? useVoiceActivity = null, bool? speak = null, bool? deafenMembers = null, bool? muteMembers = null, bool? playSoundtrack = null, bool? shareScreen = null)

Parameters

createInvites bool?
manageChannels bool?
manageRoles bool?
viewChannel bool?
sendMessages bool?
manageMessages bool?
attachFiles bool?
connect bool?
manageVoice bool?
mentionEveryone bool?
addReactions bool?
passiveConnect bool?
useVoiceActivity bool?
speak bool?
deafenMembers bool?
muteMembers bool?
playSoundtrack bool?
shareScreen bool?

Returns

ChannelPermissions

ToList()

Returns a List<T> containing all of the ChannelPermission flags that are enabled.

public List<ChannelPermission> ToList()

Returns

List<ChannelPermission>

A List<T> containing ChannelPermission flags. Empty if none are enabled.

ToString()

Gets the raw value of the permissions.

public override string ToString()

Returns

string