slash-create-modify
Version:
Create and sync Discord slash commands!
35 lines (34 loc) • 1.63 kB
TypeScript
import { ComponentActionRow, ModalSubmitRequestData } from '../../constants';
import { SlashCreator } from '../../creator';
import { RespondFunction } from '../../server';
import { Message } from '../message';
import { EditMessageOptions, MessageInteractionContext } from './messageInteraction';
/** Represents an interaction context from a modal submission. */
export declare class ModalInteractionContext extends MessageInteractionContext {
/** The request data. */
readonly data: ModalSubmitRequestData;
/** The ID of the component to identify its origin from. */
readonly customID: string;
/** The message this interaction came from, will be partial for ephemeral messages. */
readonly message?: Message;
/** The values defined in the modal submission. */
readonly values: {
[key: string]: string;
};
/**
* @param creator The instantiating creator.
* @param data The interaction data for the context.
* @param respond The response function for the interaction.
* @param useTimeout Whether to use the deferral timeout.
*/
constructor(creator: SlashCreator, data: ModalSubmitRequestData, respond: RespondFunction, useTimeout?: boolean);
static convertComponents(components: ComponentActionRow[]): {
[key: string]: string;
};
/**
* Acknowledges the interaction without replying.
* @returns Whether the acknowledgement passed
*/
acknowledge(): Promise<boolean>;
editParent(content: string | EditMessageOptions, options?: EditMessageOptions): Promise<boolean | Message>;
}