Class DiscordApplicationCommand
Represents a command that is registered to an application.
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordApplicationCommand : SnowflakeObject, IEquatable<DiscordApplicationCommand>
Constructors
| Improve this Doc View SourceDiscordApplicationCommand(String, String, IEnumerable<DiscordApplicationCommandOption>, ApplicationCommandType, DiscordApplicationCommandLocalization, DiscordApplicationCommandLocalization, Nullable<Permissions>, Nullable<Boolean>, Boolean)
Creates a new instance of a DiscordApplicationCommand.
Declaration
public DiscordApplicationCommand(string name, string description, IEnumerable<DiscordApplicationCommandOption> options = null, ApplicationCommandType type = ApplicationCommandType.ChatInput, DiscordApplicationCommandLocalization nameLocalizations = null, DiscordApplicationCommandLocalization descriptionLocalizations = null, Permissions? defaultMemberPermissions = null, bool? dmPermission = null, bool isNsfw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the command. |
System.String | description | The description of the command. |
System.Collections.Generic.IEnumerable<DiscordApplicationCommandOption> | options | Optional parameters for this command. |
ApplicationCommandType | type | The type of the command. Defaults to ChatInput. |
DiscordApplicationCommandLocalization | nameLocalizations | The localizations of the command name. |
DiscordApplicationCommandLocalization | descriptionLocalizations | The localizations of the command description. |
System.Nullable<Permissions> | defaultMemberPermissions | The default member permissions. |
System.Nullable<System.Boolean> | dmPermission | The dm permission. |
System.Boolean | isNsfw | Whether this command is NSFW. |
Properties
| Improve this Doc View SourceApplicationId
Gets the unique ID of this command's application.
Declaration
public ulong ApplicationId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
DefaultMemberPermissions
Gets the commands needed permissions.
Declaration
public Permissions? DefaultMemberPermissions { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Permissions> |
Description
Gets the description of this command.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
DescriptionLocalizations
Gets the description localizations.
Declaration
public DiscordApplicationCommandLocalization DescriptionLocalizations { get; }
Property Value
Type | Description |
---|---|
DiscordApplicationCommandLocalization |
DmPermission
Gets whether the command can be used in direct messages.
Declaration
public bool? DmPermission { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
IsNsfw
Gets whether the command is marked as NSFW.
Declaration
public bool IsNsfw { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets the name of this command.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NameLocalizations
Gets the name localizations.
Declaration
public DiscordApplicationCommandLocalization NameLocalizations { get; }
Property Value
Type | Description |
---|---|
DiscordApplicationCommandLocalization |
Options
Gets the potential parameters for this command.
Declaration
public IReadOnlyCollection<DiscordApplicationCommandOption> Options { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<DiscordApplicationCommandOption> |
Type
Gets the type of this application command.
Declaration
public ApplicationCommandType Type { get; }
Property Value
Type | Description |
---|---|
ApplicationCommandType |
Version
Gets the version number for this command.
Declaration
public ulong Version { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Methods
| Improve this Doc View SourceEquals(DiscordApplicationCommand)
Checks whether this DiscordApplicationCommand object is equal to another object.
Declaration
public bool Equals(DiscordApplicationCommand other)
Parameters
Type | Name | Description |
---|---|---|
DiscordApplicationCommand | other | The command to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the command is equal to this DiscordApplicationCommand. |
Equals(Object)
Determines if a System.Object is equal to the current DiscordApplicationCommand.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other | The object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two DiscordApplicationCommand objects are not equal. |
Overrides
GetHashCode()
Gets the hash code for this DiscordApplicationCommand.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code for this DiscordApplicationCommand. |
Overrides
Operators
| Improve this Doc View SourceEquality(DiscordApplicationCommand, DiscordApplicationCommand)
Determines if two DiscordApplicationCommand objects are equal.
Declaration
public static bool operator ==(DiscordApplicationCommand e1, DiscordApplicationCommand e2)
Parameters
Type | Name | Description |
---|---|---|
DiscordApplicationCommand | e1 | The first command object. |
DiscordApplicationCommand | e2 | The second command object. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two DiscordApplicationCommand objects are equal. |
Inequality(DiscordApplicationCommand, DiscordApplicationCommand)
Determines if two DiscordApplicationCommand objects are not equal.
Declaration
public static bool operator !=(DiscordApplicationCommand e1, DiscordApplicationCommand e2)
Parameters
Type | Name | Description |
---|---|---|
DiscordApplicationCommand | e1 | The first command object. |
DiscordApplicationCommand | e2 | The second command object. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two DiscordApplicationCommand objects are not equal. |