Interface IApplicationCommand
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
The base command model that belongs to an application.
public interface IApplicationCommand : ISnowflakeEntity, IEntity<ulong>, IDeletable
- Inherited Members
Properties
ApplicationId
Gets the unique id of the parent application.
ulong ApplicationId { get; }
Property Value
ContextTypes
Gets context types the command can be used in; null if not specified.
IReadOnlyCollection<InteractionContextType> ContextTypes { get; }
Property Value
DefaultMemberPermissions
Set of default GuildPermission required to invoke the command.
GuildPermissions DefaultMemberPermissions { get; }
Property Value
Description
Gets the description of the command.
string Description { get; }
Property Value
DescriptionLocalizations
Gets the localization dictionary for the description field of this command.
IReadOnlyDictionary<string, string> DescriptionLocalizations { get; }
Property Value
DescriptionLocalized
Gets the localized description of this command.
string DescriptionLocalized { get; }
Property Value
Remarks
Only returned when the withLocalizations
query parameter is set to false when requesting the command.
IntegrationTypes
Gets the install method for the command; null if not specified.
IReadOnlyCollection<ApplicationIntegrationType> IntegrationTypes { get; }
Property Value
IsDefaultPermission
Gets whether the command is enabled by default when the app is added to a guild.
bool IsDefaultPermission { get; }
Property Value
IsEnabledInDm
Indicates whether the command is available in DMs with the app.
[Obsolete("This property will be deprecated soon. Use ContextTypes instead.")]
bool IsEnabledInDm { get; }
Property Value
Remarks
Only for globally-scoped commands.
IsNsfw
Indicates whether the command is age restricted.
bool IsNsfw { get; }
Property Value
Name
Gets the name of the command.
string Name { get; }
Property Value
NameLocalizations
Gets the localization dictionary for the name field of this command.
IReadOnlyDictionary<string, string> NameLocalizations { get; }
Property Value
NameLocalized
Gets the localized name of this command.
string NameLocalized { get; }
Property Value
Remarks
Only returned when the withLocalizations
query parameter is set to false when requesting the command.
Options
Gets a collection of options for this application command.
IReadOnlyCollection<IApplicationCommandOption> Options { get; }
Property Value
Type
Gets the type of the command.
ApplicationCommandType Type { get; }
Property Value
Methods
ModifyAsync(Action<ApplicationCommandProperties>, RequestOptions)
Modifies the current application command.
Task ModifyAsync(Action<ApplicationCommandProperties> func, RequestOptions options = null)
Parameters
func
Action<ApplicationCommandProperties>The new properties to use when modifying the command.
options
RequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous modification operation.
ModifyAsync<TArg>(Action<TArg>, RequestOptions)
Modifies the current application command.
Task ModifyAsync<TArg>(Action<TArg> func, RequestOptions options = null) where TArg : ApplicationCommandProperties
Parameters
func
Action<TArg>The new properties to use when modifying the command.
options
RequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous modification operation.
Type Parameters
TArg
Exceptions
- InvalidOperationException
Thrown when you pass in an invalid ApplicationCommandProperties type.