Skip to main content

Class UserCommandBuilder

A class used to build user commands.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public class UserCommandBuilder

Properties​

Name​

Gets or sets the name of this User command.

View Source​
Declaration
public string Name { get; set; }

IsDefaultPermission​

Gets or sets whether the command is enabled by default when the app is added to a guild.

View Source​
Declaration
public bool IsDefaultPermission { get; set; }

Fields​

MaxNameLength​

Returns the maximum length a commands name allowed by Discord.

View Source​
Declaration
public const int MaxNameLength = 32

Methods​

Build()​

Build the current builder into a Discord.UserCommandProperties class.

View Source​
Declaration
public UserCommandProperties Build()
Returns​

Discord.UserCommandProperties: A Discord.UserCommandProperties that can be used to create user commands.### WithName(String) Sets the field name.

View Source​
Declaration
public UserCommandBuilder WithName(string name)
Returns​

Discord.UserCommandBuilder: The current builder.

Parameters​
TypeNameDescription
System.StringnameThe value to set the field name to.

WithDefaultPermission(Boolean)​

Sets the default permission of the current command.

View Source​
Declaration
public UserCommandBuilder WithDefaultPermission(bool isDefaultPermission)
Returns​

Discord.UserCommandBuilder: The current builder.

Parameters​
TypeNameDescription
System.BooleanisDefaultPermissionThe default permission value to set.