UNPKG

@wilcosp/rex

Version:

Rex is an automated command manager for discord js

46 lines (45 loc) 2.61 kB
/*! * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { APIMessage } from "discord-api-types/v10.js"; import { BooleanCache, ButtonInteraction, CacheType, InteractionDeferUpdateOptions, InteractionResponse, InteractionUpdateOptions, Message, MessagePayload, ModalSubmitInteraction } from "discord.js"; import { ExtraCommandReplyInteractionOptions, SelectMenuInteraction } from "../types/types.js"; import { RexReplyInteractionBase } from "./replyBase.js"; export declare class RexUpdateReplyInteractionBase extends RexReplyInteractionBase { inter: ModalSubmitInteraction | ButtonInteraction | SelectMenuInteraction; private debounceTimeout?; private debounceResolve?; private auditLatestOptions?; private auditTimeout?; private auditResolve?; private auditReject?; constructor(inter: ModalSubmitInteraction | ButtonInteraction | SelectMenuInteraction, opt?: ExtraCommandReplyInteractionOptions); /** * Updates the original message of the component on which the interaction was received from. * @param options The options for the updated message * @returns updated message */ update(options: InteractionUpdateOptions & { fetchReply: true; }): Promise<Message | APIMessage>; /** * Updates the original message of the component on which the interaction was received from. * @param options The options for the updated message * @returns nothing */ update(options: string | MessagePayload | InteractionUpdateOptions): Promise<void>; /** * uses debounce to update the original message of the component on which the interaction was received from * @param options The options for the updated message * @returns if fetchReply = true, the updated message, earlier attempts or fetchReply = false will return nothing * @see https://rxjs.dev/api/index/function/debounce for an visual example for how debounce works */ updateDebounce(options: string | MessagePayload | InteractionUpdateOptions): Promise<void | undefined | Message | APIMessage>; updateAudit(options: string | MessagePayload | InteractionUpdateOptions): Promise<void | undefined | Message | APIMessage>; deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true; }): Promise<Message<BooleanCache<CacheType>>>; deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse<BooleanCache<CacheType>>>; }