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

Code before:
  async update(options) {
    if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);

    let messagePayload;
    if (options instanceof MessagePayload) messagePayload = options;
    else messagePayload = MessagePayload.create(this, options);

    const { body: data, files } = await messagePayload.resolveBody().resolveFiles();

    const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
      body: {
        type: InteractionResponseType.UpdateMessage,
        data,
      },
      files,
      auth: false,
      query: makeURLSearchParams({ with_response: options.withResponse ?? false }),
    });
    this.replied = true;

    if (options.withResponse) {
      return new InteractionCallbackResponse(this.client, response);
    } else {
      return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction?.id);
    }
  }

  /**
   * Shows a modal component
   * @param {ModalBuilder|ModalComponentData|APIModalInteractionResponseCallbackData} modal The modal to show
   * @param {ShowModalOptions} options The options for sending this interaction response
   * @returns {Promise<InteractionCallbackResponse|void>}
   */
  async showModal(modal, options = {}) {
    if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
    const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
      body: {
        type: InteractionResponseType.Modal,
        data: isJSONEncodable(modal) ? modal.toJSON() : this.client.options.jsonTransformer(modal),
      },
      auth: false,
      query: makeURLSearchParams({ with_response: options.withResponse ?? false }),
    });
    this.replied = true;

    return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined;
  }

  /**
   * Responds to the interaction with an upgrade button.
   * <info>Only available for applications with monetization enabled.</info>

Review comment (suggestion):
```suggestion

    return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction?.id);
```

Code after:
    const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
      body: {
        type: InteractionResponseType.UpdateMessage,
        data,
      },
      files,
      auth: false,
      query: makeURLSearchParams({ with_response: options.withResponse ?? false }),
    });
    this.replied = true;

    return options.withResponse
      ? new InteractionCallbackResponse(this.client, response)
      : new InteractionResponse(this, this.message.interaction?.id);
  }

  /**
   * Shows a modal component
   * @param {ModalBuilder|ModalComponentData|APIModalInteractionResponseCallbackData} modal The modal to show
   * @param {ShowModalOptions} [options={}] The options for sending this interaction response
   * @returns {Promise<InteractionCallbackResponse|undefined>}
   */
  async showModal(modal, options = {}) {
    if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
    const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
      body: {
        type: InteractionResponseType.Modal,
        data: isJSONEncodable(modal) ? modal.toJSON() : this.client.options.jsonTransformer(modal),
      },
      auth: false,
      query: makeURLSearchParams({ with_response: options.withResponse ?? false }),
    });
    this.replied = true;

    return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined;
  }

  /**
   * An object containing the same properties as {@link CollectorOptions}, but a few less:
   * @typedef {Object} AwaitModalSubmitOptions
   * @property {CollectorFilter} [filter] The filter applied to this collector
   * @property {number} time Time in milliseconds to wait for an interaction before rejecting
   */

  /**
   * Collects a single modal submit interaction that passes the filter.
   * The Promise will reject if the time expires.
   * @param {AwaitModalSubmitOptions} options Options to pass to the internal collector
   * @returns {Promise<ModalSubmitInteraction>}
   * @example
   * // Collect a modal submit interaction