Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InteractionMethods

Methods for interacting with slash command specific endpoints

Hierarchy

  • InteractionMethods

Index

Constructors

  • Create a new Interaction Method Handler

    Usually SnowTransfer creates a method handler for you, this is here for completion

    You can access the methods listed via client.interaction.method, where client is an initialized SnowTransfer instance

    Parameters

    Returns <internal>.InteractionMethods

Properties

requestHandler: <internal>.RequestHandler

Methods

  • Create a followup message for an Interaction

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice const message = await client.interaction.createFollowupMessage("appId", "token", { content: "The pacer gram fitness test-" })

    Parameters

    Returns Promise<<internal>.Message>

    A message object

  • Create a response to an Interaction

    When uploading attachments to respond to message interactions, you must provide the top level files property which needs to match attachments array length and each element needs to match the same indexes as where their filename is defined (the top level files property gets deleted before it's appended to payload_json). Should you have a more elegant solution, possibly rewriting the interface with the request handler, please submit a PR/issue.

    example

    // Respond to a message interaction const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice client.interaction.createInteractionResponse("interactionId", "token", { type: 4, data: { content: "Hello World" } })

    Parameters

    • interactionId: string

      The Id of the interaction

    • token: string

      The token of the interaction

    • data: <internal>.InteractionResponse & { files?: { file: Buffer; name: string }[] }

      Response data

    Returns Promise<void>

    Resolves the Promise on successful execution

  • deleteApplicationCommand(appId: string, cmdId: string): Promise<void>
  • Deletes a global command

    example

    const client = new SnowTransfer("TOKEN") client.interaction.deleteApplicationCommand("appId", "cmdId")

    Parameters

    • appId: string

      The Id of the application

    • cmdId: string

      The Id of the command

    Returns Promise<void>

    Resolves the Promise on successful execution

  • deleteFollowupMessage(appId: string, token: string, messageId: string): Promise<void>
  • Deletes a followup message for an Interaction

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice client.interaction.deleteFollowupMessage("appId", "token", "messageId")

    Parameters

    • appId: string

      The Id of the application

    • token: string

      The token of the interaction

    • messageId: string

      The Id of the message

    Returns Promise<void>

    Resolves the Promise on successful execution

  • deleteGuildApplicationCommand(appId: string, guildId: string, cmdId: string): Promise<void>
  • Delete a guild command

    example

    const client = new SnowTransfer("TOKEN") client.interaction.deleteGuildApplicationCommand("appId", "guildId", "cmdId")

    Parameters

    • appId: string

      The Id of the application

    • guildId: string

      The Id of the guild

    • cmdId: string

      The Id of the command

    Returns Promise<void>

    Resolves the Promise on successful execution

  • deleteOriginalInteractionResponse(appId: string, token: string): Promise<void>
  • Deletes the initial Interaction response

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice client.interaction.deleteOriginalInteractionResponse("appId", "token")

    Parameters

    • appId: string

      The Id of the application

    • token: string

      The token of the interaction

    Returns Promise<void>

    Resolves the Promise on successful execution

  • Edits a followup message for an Interaction

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice const message = await client.interaction.editFollowupMessage("appId", "token", "messageId", { content: "-is a multistage aerobic capacity test" })

    Parameters

    • appId: string

      The Id of the application

    • token: string

      The token of the interaction

    • messageId: string

      The Id of the message

    • data: <internal>.WebhookEditMessageData

      The new message data

    Returns Promise<<internal>.Message>

    A message object

  • Edits the initial Interaction response

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice const message = await client.interaction.editOriginalInteractionResponse("appId", "token", { content: "The world said hello back" })

    Parameters

    Returns Promise<<internal>.Message>

    A message object

  • Get a followup message for an Interaction

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice const message = await client.interaction.getFollowupMessage("appId", "token", "messageId")

    Parameters

    • appId: string

      The Id of the application

    • token: string

      The token of the interaction

    • messageId: string

      The Id of the message

    Returns Promise<<internal>.Message>

    A message object

  • Returns the initial Interaction response

    example

    const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice const message = await client.interaction.getOriginalInteractionResponse("appId", "token")

    Parameters

    • appId: string

      The Id of the application

    • token: string

      The token of the interaction

    Returns Promise<<internal>.Message>

    A message object

Generated using TypeDoc