Repository: discordjs/discord.js
File: packages/discord.js/src/structures/interfaces/InteractionResponses.js (JavaScript)

Code before:

const { makeURLSearchParams } = require('@discordjs/rest');
const { isJSONEncodable } = require('@discordjs/util');
const { InteractionResponseType, MessageFlags, Routes, InteractionType } = require('discord-api-types/v10');
const { DiscordjsError, ErrorCodes } = require('../../errors');
const InteractionCallbackResponse = require('../InteractionCallbackResponse');
const InteractionCollector = require('../InteractionCollector');
const InteractionResponse = require('../InteractionResponse');
const MessagePayload = require('../MessagePayload');

/**
 * @typedef {Object} ModalComponentData
 * @property {string} title The title of the modal
 * @property {string} customId The custom id of the modal
 * @property {ActionRow[]} components The components within this modal
 */

/**
 * Interface for classes that support shared interaction response types.
 * @interface
 */
class InteractionResponses {
  /**
   * Shared options for responses to a {@link BaseInteraction}.
   * @typedef {Object} SharedInteractionResponseOptions
   * @property {boolean} [withResponse] Whether to include an {@link InteractionCallbackResponse} as the response
   */

  /**
   * Options for deferring the reply to an {@link BaseInteraction}.
   * @typedef {SharedInteractionResponseOptions} InteractionDeferReplyOptions
   * @property {MessageFlagsResolvable} [flags] Flags for the reply.
   * <info>Only `MessageFlags.Ephemeral` can be set.</info>
   * @property {boolean} [fetchReply] Whether to fetch the reply
   */

  /**
   * Options for deferring and updating the reply to a {@link MessageComponentInteraction}.
   * @typedef {SharedInteractionResponseOptions} InteractionDeferUpdateOptions
   * @property {boolean} [fetchReply] Whether to fetch the reply
   */

  /**
   * Options for a reply to a {@link BaseInteraction}.
   * @typedef {BaseMessageOptionsWithPoll|SharedInteractionResponseOptions} InteractionReplyOptions
   * @property {boolean} [tts=false] Whether the message should be spoken aloud
   * @property {boolean} [fetchReply] Whether to fetch the reply
   * @property {MessageFlagsResolvable} [flags] Which flags to set for the message.
   * <info>Only `MessageFlags.Ephemeral`, `MessageFlags.SuppressEmbeds`, and `MessageFlags.SuppressNotifications`
   * can be set.</info>
   */

Review comment (suggestion):
```suggestion
   * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
```

Code after:

const { makeURLSearchParams } = require('@discordjs/rest');
const { isJSONEncodable } = require('@discordjs/util');
const { InteractionResponseType, MessageFlags, Routes, InteractionType } = require('discord-api-types/v10');
const { DiscordjsError, ErrorCodes } = require('../../errors');
const InteractionCallbackResponse = require('../InteractionCallbackResponse');
const InteractionCollector = require('../InteractionCollector');
const InteractionResponse = require('../InteractionResponse');
const MessagePayload = require('../MessagePayload');

/**
 * @typedef {Object} ModalComponentData
 * @property {string} title The title of the modal
 * @property {string} customId The custom id of the modal
 * @property {ActionRow[]} components The components within this modal
 */

/**
 * Interface for classes that support shared interaction response types.
 * @interface
 */
class InteractionResponses {
  /**
   * Options for deferring the reply to an {@link BaseInteraction}.
   * @typedef {Object} InteractionDeferReplyOptions
   * @property {MessageFlagsResolvable} [flags] Flags for the reply.
   * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
   * <info>Only `MessageFlags.Ephemeral` can be set.</info>
   */

  /**
   * Options for deferring and updating the reply to a {@link MessageComponentInteraction}.
   * @typedef {Object} InteractionDeferUpdateOptions
   * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
   */

  /**
   * Options for a reply to a {@link BaseInteraction}.
   * @typedef {BaseMessageOptionsWithPoll} InteractionReplyOptions
   * @property {boolean} [tts=false] Whether the message should be spoken aloud
   * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
   * @property {MessageFlagsResolvable} [flags] Which flags to set for the message.
   * <info>Only `MessageFlags.Ephemeral`, `MessageFlags.SuppressEmbeds`, and `MessageFlags.SuppressNotifications`
   * can be set.</info>
   */

  /**
   * Options for updating the message received from a {@link MessageComponentInteraction}.
   * @typedef {MessageEditOptions} InteractionUpdateOptions
   * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
   */