Table of Contents

Class UserCommandProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll

User commands are application commands that appear on the context menu (right click or tap) of users. They are a great way to surface quick actions for your app that target users.

public class UserCommandProperties : ApplicationCommandProperties, IJsonSerializable
Inheritance
UserCommandProperties
Implements
Inherited Members

Constructors

UserCommandProperties(string)

User commands are application commands that appear on the context menu (right click or tap) of users. They are a great way to surface quick actions for your app that target users.

public UserCommandProperties(string name)

Parameters

name string
Name of the command (1-32 characters).

Methods

AddContexts(params IEnumerable<InteractionContextType>)

Interaction context(s) where the command can be used.

public UserCommandProperties AddContexts(params IEnumerable<InteractionContextType> contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

UserCommandProperties

AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType>)

Installation context(s) where the command is available.

public UserCommandProperties AddIntegrationTypes(params IEnumerable<ApplicationIntegrationType> integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

UserCommandProperties

WithContexts(IEnumerable<InteractionContextType>?)

Interaction context(s) where the command can be used.

public UserCommandProperties WithContexts(IEnumerable<InteractionContextType>? contexts)

Parameters

contexts IEnumerable<InteractionContextType>

Returns

UserCommandProperties

WithDMPermission(bool?)

Indicates whether the command is available in DMs with the app.

[Obsolete("Replaced by 'Contexts'.")]
public UserCommandProperties WithDMPermission(bool? dMPermission = true)

Parameters

dMPermission bool?

Returns

UserCommandProperties

WithDefaultGuildUserPermissions(Permissions?)

Default required permissions to use the command.

public UserCommandProperties WithDefaultGuildUserPermissions(Permissions? defaultGuildUserPermissions)

Parameters

defaultGuildUserPermissions Permissions?

Returns

UserCommandProperties

WithDefaultPermission(bool?)

Indicates whether the command is enabled by default when the app is added to a guild.

[Obsolete("Replaced by 'DefaultGuildUserPermissions'.")]
public UserCommandProperties WithDefaultPermission(bool? defaultPermission = true)

Parameters

defaultPermission bool?

Returns

UserCommandProperties

WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>?)

Installation context(s) where the command is available.

public UserCommandProperties WithIntegrationTypes(IEnumerable<ApplicationIntegrationType>? integrationTypes)

Parameters

integrationTypes IEnumerable<ApplicationIntegrationType>

Returns

UserCommandProperties

WithName(string)

Name of the command (1-32 characters).

public UserCommandProperties WithName(string name)

Parameters

name string

Returns

UserCommandProperties

WithNameLocalizations(IReadOnlyDictionary<string, string>?)

Localizations of Name (1-32 characters each).

public UserCommandProperties WithNameLocalizations(IReadOnlyDictionary<string, string>? nameLocalizations)

Parameters

nameLocalizations IReadOnlyDictionary<string, string>

Returns

UserCommandProperties

WithNsfw(bool)

Indicates whether the command is age-restricted.

public UserCommandProperties WithNsfw(bool nsfw = true)

Parameters

nsfw bool

Returns

UserCommandProperties

WriteTo(Utf8JsonWriter)

public override void WriteTo(Utf8JsonWriter writer)

Parameters

writer Utf8JsonWriter