Class ContextCommandBuilder
Represents a builder for creating ContextCommandInfo.
Inheritance
Implements
Inherited Members
Namespace: Discord.Interactions.Builders
Assembly: Discord.Net.Interactions.dll
Syntax
public sealed class ContextCommandBuilder : CommandBuilder<ContextCommandInfo, ContextCommandBuilder, CommandParameterBuilder>, ICommandBuilder
Constructors
| Improve this Doc View SourceContextCommandBuilder(ModuleBuilder, String, ExecuteCallback)
Initializes a new ContextCommandBuilder.
Declaration
public ContextCommandBuilder(ModuleBuilder module, string name, ExecuteCallback callback)
Parameters
Type | Name | Description |
---|---|---|
ModuleBuilder | module | Parent module of this command. |
String | name | Name of this command. |
ExecuteCallback | callback | Execution callback of this command. |
Properties
| Improve this Doc View SourceCommandType
Gets the type of this command.
Declaration
public ApplicationCommandType CommandType { get; set; }
Property Value
Type | Description |
---|---|
ApplicationCommandType |
DefaultMemberPermissions
Gets the default permissions needed for executing this command.
Declaration
public GuildPermission? DefaultMemberPermissions { get; set; }
Property Value
Type | Description |
---|---|
Nullable<GuildPermission> |
DefaultPermission
Gets the default permission of this command.
Declaration
public bool DefaultPermission { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Instance
Declaration
protected override ContextCommandBuilder Instance { get; }
Property Value
Type | Description |
---|---|
ContextCommandBuilder |
Overrides
IsEnabledInDm
Gets whether this command can be used in DMs.
Declaration
public bool IsEnabledInDm { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsNsfw
Gets whether this command is age restricted.
Declaration
public bool IsNsfw { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceAddParameter(Action<CommandParameterBuilder>)
Adds a command parameter to the parameters collection.
Declaration
public override ContextCommandBuilder AddParameter(Action<CommandParameterBuilder> configure)
Parameters
Type | Name | Description |
---|---|---|
Action<CommandParameterBuilder> | configure | CommandParameterBuilder factory. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |
Overrides
SetDefaultPermission(Boolean)
Sets DefaultPermission.
Declaration
public ContextCommandBuilder SetDefaultPermission(bool defaultPermision)
Parameters
Type | Name | Description |
---|---|---|
Boolean | defaultPermision | New value of the DefaultPermission. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |
SetEnabledInDm(Boolean)
Sets IsEnabledInDm.
Declaration
public ContextCommandBuilder SetEnabledInDm(bool isEnabled)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isEnabled | New value of the IsEnabledInDm. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |
SetNsfw(Boolean)
Sets IsNsfw.
Declaration
public ContextCommandBuilder SetNsfw(bool isNsfw)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isNsfw | New value of the IsNsfw. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |
SetType(ApplicationCommandType)
Sets CommandType.
Declaration
public ContextCommandBuilder SetType(ApplicationCommandType commandType)
Parameters
Type | Name | Description |
---|---|---|
ApplicationCommandType | commandType | New value of the CommandType. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |
WithDefaultMemberPermissions(GuildPermission)
Sets DefaultMemberPermissions.
Declaration
public ContextCommandBuilder WithDefaultMemberPermissions(GuildPermission permissions)
Parameters
Type | Name | Description |
---|---|---|
GuildPermission | permissions | New value of the DefaultMemberPermissions. |
Returns
Type | Description |
---|---|
ContextCommandBuilder | The builder instance. |