Class SocketApplicationCommand
Represents a Websocket-based IApplicationCommand.
public class SocketApplicationCommand : SocketEntity<ulong>, IApplicationCommand, ISnowflakeEntity, IEntity<ulong>, IDeletable
- Inheritance
-
SocketApplicationCommand
- Implements
- Inherited Members
Properties
ApplicationId
Gets the unique id of the parent application.
public ulong ApplicationId { get; }
Property Value
ContextTypes
Gets context types the command can be used in; null if not specified.
public IReadOnlyCollection<InteractionContextType> ContextTypes { get; }
Property Value
CreatedAt
Gets when the snowflake was created.
public DateTimeOffset CreatedAt { get; }
Property Value
- DateTimeOffset
A DateTimeOffset representing when the entity was first created.
DefaultMemberPermissions
Set of default GuildPermission required to invoke the command.
public GuildPermissions DefaultMemberPermissions { get; }
Property Value
Description
Gets the description of the command.
public string Description { get; }
Property Value
DescriptionLocalizations
Gets the localization dictionary for the description field of this command.
public IReadOnlyDictionary<string, string> DescriptionLocalizations { get; }
Property Value
DescriptionLocalized
Gets the localized description of this command.
public string DescriptionLocalized { get; }
Property Value
Remarks
Only returned when the withLocalizations
query parameter is set to false when requesting the command.
Guild
Gets the guild this command resides in; if this command is a global command then it will return null
public SocketGuild Guild { get; }
Property Value
IntegrationTypes
Gets the install method for the command; null if not specified.
public IReadOnlyCollection<ApplicationIntegrationType> IntegrationTypes { get; }
Property Value
IsDefaultPermission
Gets whether the command is enabled by default when the app is added to a guild.
public 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.")]
public bool IsEnabledInDm { get; }
Property Value
Remarks
Only for globally-scoped commands.
IsGlobalCommand
Gets whether or not this command is a global application command.
public bool IsGlobalCommand { get; }
Property Value
IsNsfw
Indicates whether the command is age restricted.
public bool IsNsfw { get; }
Property Value
Name
Gets the name of the command.
public string Name { get; }
Property Value
NameLocalizations
Gets the localization dictionary for the name field of this command.
public IReadOnlyDictionary<string, string> NameLocalizations { get; }
Property Value
NameLocalized
Gets the localized name of this command.
public 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 SocketApplicationCommandOptions for this command.
public IReadOnlyCollection<SocketApplicationCommandOption> Options { get; }
Property Value
Remarks
If the Type is not a slash command, this field will be an empty collection.
Type
Gets the type of the command.
public ApplicationCommandType Type { get; }
Property Value
Methods
DeleteAsync(RequestOptions)
Deletes this object and all its children.
public Task DeleteAsync(RequestOptions options = null)
Parameters
options
RequestOptionsThe options to be used when sending the request.
Returns
ModifyAsync(Action<ApplicationCommandProperties>, RequestOptions)
Modifies the current application command.
public 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.
public 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.