Class ApplicationCommandPermission
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
public class ApplicationCommandPermission
- Inheritance
-
ApplicationCommandPermission
- Inherited Members
Constructors
ApplicationCommandPermission(IChannel, bool)
Creates a new ApplicationCommandPermission targeting Channel.
public ApplicationCommandPermission(IChannel channel, bool allow)
Parameters
channelIChannelThe channel you want to target this permission value for.
allowboolThe value of this permission.
ApplicationCommandPermission(IRole, bool)
Creates a new ApplicationCommandPermission targeting Role.
public ApplicationCommandPermission(IRole target, bool allow)
Parameters
targetIRoleThe role you want to target this permission value for.
allowboolThe value of this permission.
ApplicationCommandPermission(IUser, bool)
Creates a new ApplicationCommandPermission targeting User.
public ApplicationCommandPermission(IUser target, bool allow)
Parameters
targetIUserThe user you want to target this permission value for.
allowboolThe value of this permission.
ApplicationCommandPermission(ulong, ApplicationCommandPermissionTarget, bool)
Creates a new ApplicationCommandPermission.
public ApplicationCommandPermission(ulong targetId, ApplicationCommandPermissionTarget targetType, bool allow)
Parameters
targetIdulongThe id you want to target this permission value for.
targetTypeApplicationCommandPermissionTargetThe type of the targetId parameter.
allowboolThe value of this permission.
Properties
Permission
public bool Permission { get; }
Property Value
TargetId
The id of the role or user.
public ulong TargetId { get; }
Property Value
TargetType
The target of this permission.
public ApplicationCommandPermissionTarget TargetType { get; }
Property Value
Methods
ForAllChannels(IGuild, bool)
Creates a new ApplicationCommandPermission targeting every channel in a guild.
public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow)
Parameters
Returns
- ApplicationCommandPermission
Instance of ApplicationCommandPermission targeting every channel in a guild.
ForAllChannels(ulong, bool)
Creates a new ApplicationCommandPermission targeting every channel in a guild.
public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow)
Parameters
Returns
- ApplicationCommandPermission
Instance of ApplicationCommandPermission targeting every channel in a guild.
ForEveryone(IGuild, bool)
Creates a new ApplicationCommandPermission targeting @everyone in a guild.
public static ApplicationCommandPermission ForEveryone(IGuild guild, bool allow)
Parameters
Returns
- ApplicationCommandPermission
Instance of ApplicationCommandPermission targeting @everyone in a guild.
ForEveryone(ulong, bool)
Creates a new ApplicationCommandPermission targeting @everyone in a guild.
public static ApplicationCommandPermission ForEveryone(ulong guildId, bool allow)
Parameters
Returns
- ApplicationCommandPermission
Instance of ApplicationCommandPermission targeting @everyone in a guild.