mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
@@ -478,19 +478,21 @@ client.on('messageCreate', async message => {
|
|||||||
buttonCollector.on('end', (...args) => expectType<[ReadonlyCollection<Snowflake, ButtonInteraction>, string]>(args));
|
buttonCollector.on('end', (...args) => expectType<[ReadonlyCollection<Snowflake, ButtonInteraction>, string]>(args));
|
||||||
|
|
||||||
// Verify that select menus interaction are inferred.
|
// Verify that select menus interaction are inferred.
|
||||||
const selectMenuCollector = message.createMessageComponentCollector({ componentType: ComponentType.StringSelect });
|
const stringSelectMenuCollector = message.createMessageComponentCollector({
|
||||||
|
componentType: ComponentType.StringSelect,
|
||||||
|
});
|
||||||
expectAssignable<Promise<StringSelectMenuInteraction>>(
|
expectAssignable<Promise<StringSelectMenuInteraction>>(
|
||||||
message.awaitMessageComponent({ componentType: ComponentType.StringSelect }),
|
message.awaitMessageComponent({ componentType: ComponentType.StringSelect }),
|
||||||
);
|
);
|
||||||
expectAssignable<Promise<StringSelectMenuInteraction>>(
|
expectAssignable<Promise<StringSelectMenuInteraction>>(
|
||||||
channel.awaitMessageComponent({ componentType: ComponentType.StringSelect }),
|
channel.awaitMessageComponent({ componentType: ComponentType.StringSelect }),
|
||||||
);
|
);
|
||||||
expectAssignable<InteractionCollector<StringSelectMenuInteraction>>(selectMenuCollector);
|
expectAssignable<InteractionCollector<StringSelectMenuInteraction>>(stringSelectMenuCollector);
|
||||||
|
|
||||||
selectMenuCollector.on('collect', (...args) => expectType<[SelectMenuInteraction]>(args));
|
stringSelectMenuCollector.on('collect', (...args) => expectType<[StringSelectMenuInteraction]>(args));
|
||||||
selectMenuCollector.on('dispose', (...args) => expectType<[SelectMenuInteraction]>(args));
|
stringSelectMenuCollector.on('dispose', (...args) => expectType<[StringSelectMenuInteraction]>(args));
|
||||||
selectMenuCollector.on('end', (...args) =>
|
stringSelectMenuCollector.on('end', (...args) =>
|
||||||
expectType<[ReadonlyCollection<Snowflake, SelectMenuInteraction>, string]>(args),
|
expectType<[ReadonlyCollection<Snowflake, StringSelectMenuInteraction>, string]>(args),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Verify that message component interactions are default collected types.
|
// Verify that message component interactions are default collected types.
|
||||||
@@ -499,10 +501,10 @@ client.on('messageCreate', async message => {
|
|||||||
expectAssignable<Promise<MessageComponentInteraction>>(channel.awaitMessageComponent());
|
expectAssignable<Promise<MessageComponentInteraction>>(channel.awaitMessageComponent());
|
||||||
expectAssignable<InteractionCollector<CollectedMessageInteraction>>(defaultCollector);
|
expectAssignable<InteractionCollector<CollectedMessageInteraction>>(defaultCollector);
|
||||||
|
|
||||||
defaultCollector.on('collect', (...args) => expectType<[MessageComponentInteraction]>(args));
|
defaultCollector.on('collect', (...args) => expectType<[SelectMenuInteraction | ButtonInteraction]>(args));
|
||||||
defaultCollector.on('dispose', (...args) => expectType<[MessageComponentInteraction]>(args));
|
defaultCollector.on('dispose', (...args) => expectType<[SelectMenuInteraction | ButtonInteraction]>(args));
|
||||||
defaultCollector.on('end', (...args) =>
|
defaultCollector.on('end', (...args) =>
|
||||||
expectType<[ReadonlyCollection<Snowflake, MessageComponentInteraction>, string]>(args),
|
expectType<[ReadonlyCollection<Snowflake, SelectMenuInteraction | ButtonInteraction>, string]>(args),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Verify that additional options don't affect default collector types.
|
// Verify that additional options don't affect default collector types.
|
||||||
|
|||||||
Reference in New Issue
Block a user