mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types(InteractionCallbackResponse): add missing InGuild generic (#10767)
Co-authored-by: TÆMBØ <TAEMBO@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
78
packages/discord.js/typings/index.d.ts
vendored
78
packages/discord.js/typings/index.d.ts
vendored
@@ -571,27 +571,31 @@ 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>>>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public deferReply(
|
||||
options?: InteractionDeferReplyOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
||||
public editReply(
|
||||
options: string | MessagePayload | InteractionEditReplyOptions,
|
||||
): 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>>>;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public reply(
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
): 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>
|
||||
@@ -605,7 +609,7 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
options?: ShowModalOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public awaitModalSubmit(
|
||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||
): Promise<ModalSubmitInteraction<Cached>>;
|
||||
@@ -1952,17 +1956,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;
|
||||
}
|
||||
|
||||
@@ -2265,37 +2269,45 @@ 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>>>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public deferReply(
|
||||
options?: InteractionDeferReplyOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public deferUpdate(options?: InteractionDeferUpdateOptions & { withResponse: false }): Promise<undefined>;
|
||||
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public deferUpdate(
|
||||
options?: InteractionDeferUpdateOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
||||
public editReply(
|
||||
options: string | MessagePayload | InteractionEditReplyOptions,
|
||||
): 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>>>;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public reply(
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
public update(options: InteractionUpdateOptions & { withResponse: true }): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public update(
|
||||
options: InteractionUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public update(options: InteractionUpdateOptions & { withResponse: false }): Promise<undefined>;
|
||||
public update(
|
||||
options: string | MessagePayload | InteractionUpdateOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
): 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>
|
||||
@@ -2309,7 +2321,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
options?: ShowModalOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public awaitModalSubmit(
|
||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||
): Promise<ModalSubmitInteraction<Cached>>;
|
||||
@@ -2477,9 +2489,13 @@ 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>>>;
|
||||
update(options: InteractionUpdateOptions & { withResponse: false }): Promise<undefined>;
|
||||
update(options: string | MessagePayload | InteractionUpdateOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
update(
|
||||
options: string | MessagePayload | InteractionUpdateOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>;
|
||||
inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>;
|
||||
inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>;
|
||||
@@ -2496,27 +2512,33 @@ 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>>>;
|
||||
public reply(options: InteractionReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public reply(
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionCallbackResponse | undefined>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
||||
public editReply(
|
||||
options: string | MessagePayload | InteractionEditReplyOptions,
|
||||
): Promise<Message<BooleanCache<Cached>>>;
|
||||
public deferReply(
|
||||
options: InteractionDeferReplyOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise<undefined>;
|
||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public deferReply(
|
||||
options?: InteractionDeferReplyOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public fetchReply(message?: Snowflake | '@original'): Promise<Message<BooleanCache<Cached>>>;
|
||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message<BooleanCache<Cached>>>;
|
||||
public deferUpdate(
|
||||
options: InteractionDeferUpdateOptions & { withResponse: true },
|
||||
): Promise<InteractionCallbackResponse>;
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>>>;
|
||||
public deferUpdate(options?: InteractionDeferUpdateOptions & { withResponse: false }): Promise<undefined>;
|
||||
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionCallbackResponse | undefined>;
|
||||
public deferUpdate(
|
||||
options?: InteractionDeferUpdateOptions,
|
||||
): Promise<InteractionCallbackResponse<BooleanCache<Cached>> | undefined>;
|
||||
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
|
||||
public inCachedGuild(): this is ModalSubmitInteraction<'cached'>;
|
||||
public inRawGuild(): this is ModalSubmitInteraction<'raw'>;
|
||||
|
||||
@@ -450,7 +450,7 @@ client.on('messageCreate', async message => {
|
||||
expectAssignable<Message<true>>(message);
|
||||
const component = await message.awaitMessageComponent({ componentType: ComponentType.Button });
|
||||
expectType<ButtonInteraction<'cached'>>(component);
|
||||
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);
|
||||
@@ -1878,21 +1878,21 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<MessageActionRowComponent>(interaction.component);
|
||||
expectType<Message<true>>(interaction.message);
|
||||
expectType<Guild>(interaction.guild);
|
||||
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<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<undefined>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<undefined>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.reply({ content: 'a', withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.deferReply({ withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
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<undefined>>(interaction.deferUpdate());
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
@@ -1900,25 +1900,25 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<APIButtonComponent | APISelectMenuComponent>(interaction.component);
|
||||
expectType<Message<false>>(interaction.message);
|
||||
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<undefined>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<undefined>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.reply({ content: 'a', withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.deferReply({ withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.update({ content: 'a', withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.update({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.update({ content: 'a', withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.deferUpdate());
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
} else if (interaction.inGuild()) {
|
||||
@@ -1979,15 +1979,15 @@ client.on('interactionCreate', async interaction => {
|
||||
expectAssignable<ContextMenuCommandInteraction>(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<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<undefined>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<undefined>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.reply({ content: 'a', withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<true> | undefined>>(
|
||||
interaction.deferReply({ withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
@@ -1996,15 +1996,15 @@ client.on('interactionCreate', async interaction => {
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<ContextMenuCommandInteraction>(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<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<undefined>>(interaction.reply({ content: 'a', withResponse: false }));
|
||||
expectType<Promise<undefined>>(interaction.deferReply({ withResponse: false }));
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.reply({ content: 'a', withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<InteractionCallbackResponse | undefined>>(
|
||||
expectType<Promise<InteractionCallbackResponse<false> | undefined>>(
|
||||
interaction.deferReply({ withResponse: booleanValue }),
|
||||
);
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
@@ -2077,13 +2077,13 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<ButtonComponent>(interaction.component);
|
||||
expectType<Message<true>>(interaction.message);
|
||||
expectType<Guild>(interaction.guild);
|
||||
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<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);
|
||||
@@ -2105,13 +2105,13 @@ client.on('interactionCreate', async interaction => {
|
||||
expectType<StringSelectMenuComponent>(interaction.component);
|
||||
expectType<Message<true>>(interaction.message);
|
||||
expectType<Guild>(interaction.guild);
|
||||
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<InteractionCallbackResponse>>(interaction.reply({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.reply({ withResponse: true }));
|
||||
} else if (interaction.inGuild()) {
|
||||
expectAssignable<StringSelectMenuInteraction>(interaction);
|
||||
expectType<StringSelectMenuComponent | APIStringSelectComponent>(interaction.component);
|
||||
@@ -2128,7 +2128,7 @@ client.on('interactionCreate', async interaction => {
|
||||
if (interaction.inRawGuild()) {
|
||||
expectNotAssignable<Interaction<'cached'>>(interaction);
|
||||
expectAssignable<ChatInputCommandInteraction>(interaction);
|
||||
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 => {
|
||||
} else if (interaction.inCachedGuild()) {
|
||||
expectType<GuildMember | null>(interaction.options.getMember('test'));
|
||||
expectAssignable<ChatInputCommandInteraction>(interaction);
|
||||
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));
|
||||
@@ -2215,23 +2215,23 @@ client.on('interactionCreate', async interaction => {
|
||||
if (interaction.inCachedGuild()) {
|
||||
expectAssignable<ModalSubmitInteraction>(interaction);
|
||||
expectType<Guild>(interaction.guild);
|
||||
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<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<Message<true>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<true>>>(interaction.fetchReply());
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<true>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.deferUpdate());
|
||||
expectType<Promise<Message<true>>>(interaction.followUp({ content: 'a' }));
|
||||
} else if (interaction.inRawGuild()) {
|
||||
expectAssignable<ModalSubmitInteraction>(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<undefined>>(interaction.deferReply());
|
||||
expectType<Promise<Message<false>>>(interaction.editReply({ content: 'a' }));
|
||||
expectType<Promise<Message<false>>>(interaction.fetchReply());
|
||||
expectType<Promise<InteractionCallbackResponse>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<InteractionCallbackResponse<false>>>(interaction.deferUpdate({ withResponse: true }));
|
||||
expectType<Promise<undefined>>(interaction.deferUpdate());
|
||||
expectType<Promise<Message<false>>>(interaction.followUp({ content: 'a' }));
|
||||
} else if (interaction.inGuild()) {
|
||||
|
||||
Reference in New Issue
Block a user