Show / Hide Table of Contents

    Class DiscordApplicationCommand

    Represents a command that is registered to an application.

    Inheritance
    Object
    SnowflakeObject
    DiscordApplicationCommand
    Inherited Members
    SnowflakeObject.Id
    SnowflakeObject.CreationTimestamp
    Namespace: DSharpPlus.Entities
    Assembly: cs.temp.dll.dll
    Syntax
    public sealed class DiscordApplicationCommand : SnowflakeObject

    Constructors

    DiscordApplicationCommand(String, String, IEnumerable<DiscordApplicationCommandOption>, Nullable<Boolean>, ApplicationCommandType, IReadOnlyDictionary<String, String>, IReadOnlyDictionary<String, String>, Nullable<Boolean>, Nullable<Permissions>)

    Creates a new instance of a DiscordApplicationCommand.

    Declaration
    public DiscordApplicationCommand(string name, string description, IEnumerable<DiscordApplicationCommandOption> options = null, bool? defaultPermission = null, ApplicationCommandType type = ApplicationCommandType.SlashCommand, IReadOnlyDictionary<string, string> name_localizations = null, IReadOnlyDictionary<string, string> description_localizations = null, bool? allowDMUsage = null, Permissions? defaultMemberPermissions = null)
    Parameters
    Type Name Description
    String name

    The name of the command.

    String description

    The description of the command.

    IEnumerable<DiscordApplicationCommandOption> options

    Optional parameters for this command.

    Nullable<Boolean> defaultPermission

    Whether the command is enabled by default when the application is added to a guild.

    ApplicationCommandType type

    The type of the application command

    IReadOnlyDictionary<String, String> name_localizations
    IReadOnlyDictionary<String, String> description_localizations
    Nullable<Boolean> allowDMUsage
    Nullable<Permissions> defaultMemberPermissions

    Properties

    AllowDMUsage

    Whether this command can be invoked in DMs.

    Declaration
    public bool? AllowDMUsage { get; }
    Property Value
    Type Description
    Nullable<Boolean>

    ApplicationId

    Gets the unique ID of this command's application.

    Declaration
    public ulong ApplicationId { get; }
    Property Value
    Type Description
    UInt64

    DefaultMemberPermissions

    What permissions this command requires to be invoked.

    Declaration
    public Permissions? DefaultMemberPermissions { get; }
    Property Value
    Type Description
    Nullable<Permissions>

    DefaultPermission

    Gets whether the command is enabled by default when the application is added to a guild.

    Declaration
    public bool? DefaultPermission { get; }
    Property Value
    Type Description
    Nullable<Boolean>

    Description

    Gets the description of this command.

    Declaration
    public string Description { get; }
    Property Value
    Type Description
    String

    DescriptionLocalizations

    Declaration
    public IReadOnlyDictionary<string, string> DescriptionLocalizations { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<String, String>

    Name

    Gets the name of this command.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    NameLocalizations

    Declaration
    public IReadOnlyDictionary<string, string> NameLocalizations { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<String, String>

    Options

    Gets the potential parameters for this command.

    Declaration
    public IReadOnlyCollection<DiscordApplicationCommandOption> Options { get; }
    Property Value
    Type Description
    IReadOnlyCollection<DiscordApplicationCommandOption>

    Type

    Gets the type of this application command.

    Declaration
    public ApplicationCommandType Type { get; }
    Property Value
    Type Description
    ApplicationCommandType

    Version

    Gets the autoincrementing version number for this command.

    Declaration
    public ulong Version { get; }
    Property Value
    Type Description
    UInt64

    Methods

    Equals(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
    Boolean

    Whether the command is equal to this DiscordApplicationCommand.

    Equals(Object)

    Determines if a Object is equal to the current DiscordApplicationCommand.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    Object other

    The object to compare to.

    Returns
    Type Description
    Boolean

    Whether the two DiscordApplicationCommand objects are not equal.

    Overrides
    Object.Equals(Object)

    GetHashCode()

    Gets the hash code for this DiscordApplicationCommand.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    The hash code for this DiscordApplicationCommand.

    Overrides
    Object.GetHashCode()

    Operators

    Equality(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
    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
    Boolean

    Whether the two DiscordApplicationCommand objects are not equal.

    Back to top © 2016-2022 DSharpPlus Contributors