Skip to main content
Module

x/harmony/mod.ts>SlashCommandInteraction

An easy to use Discord API Library for Deno.
Go to Latest
class SlashCommandInteraction
extends Interaction
import { SlashCommandInteraction } from "https://deno.land/x/harmony@v2.7.0/mod.ts";

Constructors

new
SlashCommandInteraction(
client: Client,
data: InteractionPayload,
others: { channel?: TextChannel | GuildTextChannel; guild?: Guild; member?: Member; user: User; resolved: InteractionApplicationCommandResolved; },
)

Properties

data: InteractionApplicationCommandData

Data sent with Interaction. Only applies to Application Command

guildLocale: string
locale: string
readonly
name: string

Name of the Command Used (may change with future additions to Interactions!)

readonly
options: InteractionApplicationCommandOption[]

Application Command options. Sub Command (and Group) nesting is stripped off for this

resolved: InteractionApplicationCommandResolved

Resolved data for Snowflakes in Slash Command Arguments

readonly
subCommand: string | undefined

Gets sub command name from options

readonly
subCommandGroup: string | undefined

Gets sub command group name from options

readonly
targetID: string | undefined

Target ID. Only valid for Context Menu commands

readonly
targetMessage: Message | undefined

Target Message object. Only valid for Message Context Menu commands

readonly
targetUser: User | undefined

Target User object. Only valid for User Context Menu commands

Methods

option<T extends
| number
| string
| InteractionUser
| InteractionChannel
| Role
| undefined
>
(name: string): T

Get an option by name