Class ApplicationCommand
public class ApplicationCommand : ClientEntity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonApplicationCommand>
- Inheritance
-
ApplicationCommand
- Implements
- Derived
- Inherited Members
Constructors
ApplicationCommand(JsonApplicationCommand, RestClient)
public ApplicationCommand(JsonApplicationCommand jsonModel, RestClient client)
Parameters
jsonModel
JsonApplicationCommandclient
RestClient
Properties
ApplicationId
ID of the parent application.
public ulong ApplicationId { get; }
Property Value
Contexts
Interaction context(s) where the command can be used, only for globally-scoped commands.
public IReadOnlyList<InteractionContextType>? Contexts { get; }
Property Value
DMPermission
Indicates whether the command is available in DMs with the app.
[Obsolete("Replaced by 'Contexts'.")]
public bool DMPermission { get; }
Property Value
DefaultGuildUserPermissions
Default required permissions to use the command.
public Permissions? DefaultGuildUserPermissions { get; }
Property Value
DefaultPermission
Indicates whether the command is enabled by default when the app is added to a guild.
[Obsolete("Replaced by 'DefaultGuildUserPermissions'.")]
public bool DefaultPermission { get; }
Property Value
Description
Description of the command (1-100 characters).
public string Description { get; }
Property Value
DescriptionLocalizations
Localizations of Description (1-100 characters each).
public IReadOnlyDictionary<string, string>? DescriptionLocalizations { get; }
Property Value
Id
The unique identifier for this object.
public override ulong Id { get; }
Property Value
IntegrationTypes
Installation context(s) where the command is available, only for globally-scoped commands.
public IReadOnlyList<ApplicationIntegrationType>? IntegrationTypes { get; }
Property Value
Name
Name of the command (1-32 characters).
public string Name { get; }
Property Value
NameLocalizations
Localizations of Name (1-32 characters each).
public IReadOnlyDictionary<string, string>? NameLocalizations { get; }
Property Value
Nsfw
Indicates whether the command is age-restricted.
public bool Nsfw { get; }
Property Value
Options
Parameters for the command (max 25).
public IReadOnlyList<ApplicationCommandOption> Options { get; }
Property Value
Type
Type of the command.
public ApplicationCommandType Type { get; }
Property Value
Version
Autoincrementing version identifier updated during substantial record changes.
public ulong Version { get; }
Property Value
Methods
DeleteAsync(RestRequestProperties?, CancellationToken)
public virtual Task DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetAsync(RestRequestProperties?, CancellationToken)
public virtual Task<ApplicationCommand> GetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetGuildPermissionsAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<ApplicationCommandGuildPermissions> GetGuildPermissionsAsync(ulong guildId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyAsync(Action<ApplicationCommandOptions>, RestRequestProperties?, CancellationToken)
public virtual Task<ApplicationCommand> ModifyAsync(Action<ApplicationCommandOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<ApplicationCommandOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
OverwriteGuildPermissionsAsync(ulong, IEnumerable<ApplicationCommandGuildPermissionProperties>, RestRequestProperties?, CancellationToken)
public Task<ApplicationCommandGuildPermissions> OverwriteGuildPermissionsAsync(ulong guildId, IEnumerable<ApplicationCommandGuildPermissionProperties> newPermissions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildId
ulongnewPermissions
IEnumerable<ApplicationCommandGuildPermissionProperties>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ToString()
public override string ToString()
Returns
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
public override bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
Parameters
destination
Span<char>charsWritten
intformat
ReadOnlySpan<char>provider
IFormatProvider