Options
All
  • Public
  • Public/Protected
  • All
Menu

Interactions resource

Hierarchy

  • InteractionResource

Index

Constructors

constructor

Methods

add

  • add(data: RESTPostAPIApplicationCommandsJSONBody, applicationId: string, guildId?: string): Promise<APIApplicationCommand>
  • Adds a command for an application

    Parameters

    • data: RESTPostAPIApplicationCommandsJSONBody

      Interaction data

    • applicationId: string

      Application/client ID

    • Optional guildId: string

      Optional guild ID to only add a command for a specific guild

    Returns Promise<APIApplicationCommand>

callback

  • callback(interactionId: string, interactionToken: string, data: APIInteractionResponse): Promise<null>
  • Responds to an interaction

    Parameters

    • interactionId: string

      Interaction ID

    • interactionToken: string

      Interaction Token

    • data: APIInteractionResponse

      Interaction Callback Data

    Returns Promise<null>

callbackFile

  • callbackFile(interactionId: string, interactionToken: string, data: { buffer: Buffer; name: string }, extra?: MessageTypes): Promise<null>
  • Sends a file to a channel

    Parameters

    • interactionId: string
    • interactionToken: string
    • data: { buffer: Buffer; name: string }

      File Buffer and name

      • buffer: Buffer
      • name: string
    • Optional extra: MessageTypes

      Extra message data

    Returns Promise<null>

delete

  • delete(interactionId: string, applicationId: string, guildId?: string): Promise<void>
  • Deletes a specific command for an application

    Parameters

    • interactionId: string

      Interaction ID

    • applicationId: string

      Application/client ID

    • Optional guildId: string

      Optional guild ID to only delete a command for a specific guild

    Returns Promise<void>

get

  • get(applicationId: string, guildId?: string): Promise<RESTGetAPIApplicationCommandsResult | RESTGetAPIApplicationGuildCommandsResult>
  • Gets all posted commands for an application

    Parameters

    • applicationId: string

      Application/client ID

    • Optional guildId: string

      Optional guild ID to only get commands from a specific guild

    Returns Promise<RESTGetAPIApplicationCommandsResult | RESTGetAPIApplicationGuildCommandsResult>

set

  • set(data: RESTPutAPIApplicationCommandsJSONBody | RESTPutAPIApplicationGuildCommandsJSONBody, applicationId: string, guildId?: string): Promise<RESTPutAPIApplicationCommandsResult | RESTPutAPIApplicationGuildCommandsResult>
  • Sets all commands for an application, clearing previous

    Parameters

    • data: RESTPutAPIApplicationCommandsJSONBody | RESTPutAPIApplicationGuildCommandsJSONBody

      An array of interaction data

    • applicationId: string

      Application/client ID

    • Optional guildId: string

      Optional guild ID to only set commands for specific guild

    Returns Promise<RESTPutAPIApplicationCommandsResult | RESTPutAPIApplicationGuildCommandsResult>

update

  • update(data: Partial<RESTPostAPIApplicationCommandsJSONBody>, applicationId: string, interactionId: string, guildId?: string): Promise<APIApplicationCommand>
  • Updates/upserts a specific command

    Parameters

    • data: Partial<RESTPostAPIApplicationCommandsJSONBody>

      Interaction data

    • applicationId: string

      Application/client ID

    • interactionId: string

      Interaction ID

    • Optional guildId: string

      Optional guild ID to only update a command for a specific guild

    Returns Promise<APIApplicationCommand>

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Static method

Generated using TypeDoc