mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
types(InteractionCallbackResponse): add missing InGuild generic (#10963)
This commit is contained in:
68
packages/discord.js/typings/index.d.ts
vendored
68
packages/discord.js/typings/index.d.ts
vendored
@@ -599,7 +599,7 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
||||
public inRawGuild(): this is CommandInteraction<'raw'>;
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { fetchReply: true },
|
||||
@@ -611,29 +611,35 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
||||
): Promise<Message<BooleanCache<Cached>>>;
|
||||
public fetchReply(message?: Snowflake | '@original'): Promise<Message<BooleanCache<Cached>>>;
|
||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message<BooleanCache<Cached>>>;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public reply(
|
||||
options: InteractionReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<Message<BooleanCache<Cached>>>;
|
||||
public reply(
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public launchActivity(options: LaunchActivityOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public launchActivity(
|
||||
options: LaunchActivityOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise<undefined>;
|
||||
public launchActivity(options?: LaunchActivityOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public launchActivity(
|
||||
options?: LaunchActivityOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public showModal(
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
options: ShowModalOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public showModal(
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
options?: ShowModalOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public showModal(
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
@@ -2159,17 +2165,17 @@ export class InteractionCallback {
|
||||
public type: InteractionType;
|
||||
}
|
||||
|
||||
export class InteractionCallbackResponse {
|
||||
export class InteractionCallbackResponse<InGuild extends boolean = boolean> {
|
||||
private constructor(client: Client<true>, data: RESTPostAPIInteractionCallbackWithResponseResult);
|
||||
public readonly client: Client<true>;
|
||||
public interaction: InteractionCallback;
|
||||
public resource: InteractionCallbackResource | null;
|
||||
public resource: InteractionCallbackResource<InGuild> | null;
|
||||
}
|
||||
|
||||
export class InteractionCallbackResource {
|
||||
export class InteractionCallbackResource<InGuild extends boolean = boolean> {
|
||||
private constructor(client: Client<true>, data: RESTAPIInteractionCallbackResourceObject);
|
||||
public activityInstance: RESTAPIInteractionCallbackActivityInstanceResource | null;
|
||||
public message: Message | null;
|
||||
public message: Message<InGuild> | null;
|
||||
public type: InteractionResponseType;
|
||||
}
|
||||
|
||||
@@ -2526,7 +2532,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
public inRawGuild(): this is MessageComponentInteraction<'raw'>;
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { fetchReply: true },
|
||||
@@ -2534,7 +2540,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { fetchReply: true },
|
||||
@@ -2546,28 +2552,36 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
): Promise<Message<BooleanCache<Cached>>>;
|
||||
public fetchReply(message?: Snowflake | '@original'): Promise<Message<BooleanCache<Cached>>>;
|
||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message<BooleanCache<Cached>>>;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public reply(
|
||||
options: InteractionReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<Message<BooleanCache<Cached>>>;
|
||||
public reply(
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public update(options: InteractionUpdateOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public update(
|
||||
options: InteractionUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<Message<BooleanCache<Cached>>>;
|
||||
public update(
|
||||
options: string | MessagePayload | InteractionUpdateOptions,
|
||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public launchActivity(options: LaunchActivityOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public launchActivity(
|
||||
options: LaunchActivityOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise<undefined>;
|
||||
public launchActivity(options?: LaunchActivityOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public launchActivity(
|
||||
options?: LaunchActivityOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public showModal(
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
options: ShowModalOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public showModal(
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
@@ -2755,7 +2769,9 @@ export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = C
|
||||
extends ModalSubmitInteraction<Cached> {
|
||||
message: Message<BooleanCache<Cached>>;
|
||||
channelId: Snowflake;
|
||||
update(options: InteractionUpdateOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
update(
|
||||
options: InteractionUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<Message>;
|
||||
update(
|
||||
@@ -2777,7 +2793,9 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
|
||||
public message: Message<BooleanCache<Cached>> | null;
|
||||
public replied: boolean;
|
||||
public readonly webhook: InteractionWebhook;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public reply(
|
||||
options: InteractionReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<Message<BooleanCache<Cached>>>;
|
||||
public reply(
|
||||
@@ -2789,7 +2807,7 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
|
||||
): Promise<Message<BooleanCache<Cached>>>;
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { fetchReply: true },
|
||||
@@ -2799,7 +2817,7 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
|
||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message<BooleanCache<Cached>>>;
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated `fetchReply` is deprecated. Use `withResponse` instead or fetch the response after using the method. */
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { fetchReply: true },
|
||||
@@ -2807,9 +2825,13 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
|
||||
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
/** @deprecated Sending a premium-style button is the new Discord behaviour. */
|
||||
public sendPremiumRequired(): Promise<void>;
|
||||
public launchActivity(options: LaunchActivityOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
public launchActivity(
|
||||
options: LaunchActivityOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise<undefined>;
|
||||
public launchActivity(options?: LaunchActivityOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public launchActivity(
|
||||
options?: LaunchActivityOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
|
||||
public inCachedGuild(): this is ModalSubmitInteraction<'cached'>;
|
||||
public inRawGuild(): this is ModalSubmitInteraction<'raw'>;
|
||||
|
||||
@@ -463,7 +463,7 @@ client.on('messageCreate', async message => {
|
||||
const component = await message.awaitMessageComponent({ componentType: ComponentType.Button });
|
||||
expectType<ButtonInteraction<'cached'>>(component);
|
||||
expectType<Message<true>>(await component.reply({ fetchReply: true }));
|
||||
expectType<InteractionCallbackResponse>(await component.reply({ withResponse: true }));
|
||||
expectType<InteractionCallbackResponse<true>>(await component.reply({ withResponse: true }));
|
||||
|
||||
const buttonCollector = message.createMessageComponentCollector({ componentType: ComponentType.Button });
|
||||
expectType<InteractionCollector<ButtonInteraction<'cached'>>>(buttonCollector);
|
||||
@@ -1882,18 +1882,18 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<Guild>(interaction.guild);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<true>>>(interaction.update({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.deferUpdate({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.launchActivity({ withResponse: booleanValue }),
|
||||
);
|
||||
} else if (interaction.inRawGuild()) {
|
||||
@@ -1903,18 +1903,18 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<false>>>(interaction.update({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.deferUpdate({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.launchActivity({ withResponse: booleanValue }),
|
||||
);
|
||||
} else if (interaction.inGuild()) {
|
||||
@@ -1972,14 +1972,14 @@ client.on('interactionCreate', async interaction => {
|
||||
expectAssignable<CommandInteraction<'cached'>>(interaction);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.launchActivity({ withResponse: booleanValue }),
|
||||
);
|
||||
} else if (interaction.inRawGuild()) {
|
||||
@@ -1987,14 +1987,14 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.launchActivity({ withResponse: booleanValue }),
|
||||
);
|
||||
} else if (interaction.inGuild()) {
|
||||
@@ -2063,14 +2063,14 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<Message<true>>(interaction.message);
|
||||
expectType<Guild>(interaction.guild);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ withResponse: true }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<ButtonInteraction>(interaction);
|
||||
expectType<APIButtonComponent>(interaction.component);
|
||||
expectType<Message<false>>(interaction.message);
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ withResponse: true }));
|
||||
} else if (interaction.inGuild()) {
|
||||
expectAssignable<ButtonInteraction>(interaction);
|
||||
expectType<ButtonComponent | APIButtonComponent>(interaction.component);
|
||||
@@ -2094,14 +2094,14 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<Message<true>>(interaction.message);
|
||||
expectType<Guild>(interaction.guild);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ withResponse: true }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<StringSelectMenuInteraction>(interaction);
|
||||
expectType<APIStringSelectComponent>(interaction.component);
|
||||
expectType<Message<false>>(interaction.message);
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ withResponse: true }));
|
||||
} else if (interaction.inGuild()) {
|
||||
expectAssignable<StringSelectMenuInteraction>(interaction);
|
||||
expectType<SelectMenuComponent | APIStringSelectComponent>(interaction.component);
|
||||
@@ -2121,7 +2121,7 @@ client.on('interactionCreate', async interaction => {
|
||||
expectNotAssignable<Interaction<'cached'>>(interaction);
|
||||
expectAssignable<ChatInputCommandInteraction>(interaction);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ withResponse: true }));
|
||||
expectType<APIInteractionDataResolvedGuildMember | null>(interaction.options.getMember('test'));
|
||||
|
||||
expectType<APIInteractionDataResolvedChannel>(interaction.options.getChannel('test', true));
|
||||
@@ -2136,7 +2136,7 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<GuildMember | null>(interaction.options.getMember('test'));
|
||||
expectAssignable<ChatInputCommandInteraction>(interaction);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ withResponse: true }));
|
||||
|
||||
expectType<GuildBasedChannel>(interaction.options.getChannel('test', true));
|
||||
expectType<Role>(interaction.options.getRole('test', true));
|
||||
@@ -2208,28 +2208,28 @@ client.on('interactionCreate', async interaction => {
|
||||
expectAssignable<PrimaryEntryPointCommandInteraction>(interaction);
|
||||
expectAssignable<Guild>(interaction.guild);
|
||||
expectAssignable<CommandInteraction<'cached'>>(interaction);
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionResponse<true>>>(interaction.deferReply());
|
||||
expectType<Promise<InteractionResponse<true>>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<InteractionResponse<true>>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<PrimaryEntryPointCommandInteraction>(interaction);
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionResponse<false>>>(interaction.deferReply());
|
||||
expectType<Promise<InteractionResponse<false>>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<InteractionResponse<false>>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.launchActivity({ withResponse: false }));
|
||||
} else if (interaction.inGuild()) {
|
||||
expectAssignable<PrimaryEntryPointCommandInteraction>(interaction);
|
||||
@@ -2268,27 +2268,27 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<Guild>(interaction.guild);
|
||||
expectType<Promise<Message<true>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<true>>>(interaction.deferUpdate({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.launchActivity({ withResponse: true }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<ModalSubmitInteraction>(interaction);
|
||||
expectType<null>(interaction.guild);
|
||||
expectType<Promise<Message<false>>>(interaction.reply({ content: 'a', fetchReply: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.deferReply({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferReply({ withResponse: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<Message<false>>>(interaction.deferUpdate({ fetchReply: true }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.launchActivity({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.launchActivity({ withResponse: true }));
|
||||
} else if (interaction.inGuild()) {
|
||||
expectAssignable<ModalSubmitInteraction>(interaction);
|
||||
expectType<Guild | null>(interaction.guild);
|
||||
|
||||
Reference in New Issue
Block a user