diff --git a/packages/discord.js/src/client/actions/InteractionCreate.js b/packages/discord.js/src/client/actions/InteractionCreate.js
index 60d1b04a54ec..59b97742a89c 100644
--- a/packages/discord.js/src/client/actions/InteractionCreate.js
+++ b/packages/discord.js/src/client/actions/InteractionCreate.js
@@ -9,6 +9,7 @@ const { ChatInputCommandInteraction } = require('../../structures/ChatInputComma
const { MentionableSelectMenuInteraction } = require('../../structures/MentionableSelectMenuInteraction.js');
const { MessageContextMenuCommandInteraction } = require('../../structures/MessageContextMenuCommandInteraction.js');
const { ModalSubmitInteraction } = require('../../structures/ModalSubmitInteraction.js');
+const { PrimaryEntryPointCommandInteraction } = require('../../structures/PrimaryEntryPointCommandInteraction.js');
const { RoleSelectMenuInteraction } = require('../../structures/RoleSelectMenuInteraction.js');
const { StringSelectMenuInteraction } = require('../../structures/StringSelectMenuInteraction.js');
const { UserContextMenuCommandInteraction } = require('../../structures/UserContextMenuCommandInteraction.js');
@@ -38,6 +39,9 @@ class InteractionCreateAction extends Action {
if (channel && !channel.isTextBased()) return;
InteractionClass = MessageContextMenuCommandInteraction;
break;
+ case ApplicationCommandType.PrimaryEntryPoint:
+ InteractionClass = PrimaryEntryPointCommandInteraction;
+ break;
default:
client.emit(
Events.Debug,
diff --git a/packages/discord.js/src/index.js b/packages/discord.js/src/index.js
index a93413cd241a..668b6f080dff 100644
--- a/packages/discord.js/src/index.js
+++ b/packages/discord.js/src/index.js
@@ -186,6 +186,8 @@ exports.PartialGroupDMChannel = require('./structures/PartialGroupDMChannel.js')
exports.PermissionOverwrites = require('./structures/PermissionOverwrites.js').PermissionOverwrites;
exports.Poll = require('./structures/Poll.js').Poll;
exports.PollAnswer = require('./structures/PollAnswer.js').PollAnswer;
+exports.PrimaryEntryPointCommandInteraction =
+ require('./structures/PrimaryEntryPointCommandInteraction.js').PrimaryEntryPointCommandInteraction;
exports.Presence = require('./structures/Presence.js').Presence;
exports.ReactionCollector = require('./structures/ReactionCollector.js').ReactionCollector;
exports.ReactionEmoji = require('./structures/ReactionEmoji.js').ReactionEmoji;
diff --git a/packages/discord.js/src/managers/ApplicationCommandManager.js b/packages/discord.js/src/managers/ApplicationCommandManager.js
index 2498eca7219a..5cec2bbf0378 100644
--- a/packages/discord.js/src/managers/ApplicationCommandManager.js
+++ b/packages/discord.js/src/managers/ApplicationCommandManager.js
@@ -282,6 +282,7 @@ class ApplicationCommandManager extends CachedManager {
default_member_permissions,
integration_types: command.integrationTypes ?? command.integration_types,
contexts: command.contexts,
+ handler: command.handler,
};
}
}
diff --git a/packages/discord.js/src/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js
index 0dd9cee58915..95ab6fff8ee0 100644
--- a/packages/discord.js/src/structures/ApplicationCommand.js
+++ b/packages/discord.js/src/structures/ApplicationCommand.js
@@ -162,6 +162,18 @@ class ApplicationCommand extends Base {
this.contexts ??= null;
}
+ if ('handler' in data) {
+ /**
+ * Determines whether the interaction is handled by the app's interactions handler or by Discord.
+ * Only available for {@link ApplicationCommandType.PrimaryEntryPoint} commands on
+ * applications with the {@link ApplicationFlags.Embedded} flag (i.e, those that have an Activity)
+ * @type {?EntryPointCommandHandlerType}
+ */
+ this.handler = data.handler;
+ } else {
+ this.handler ??= null;
+ }
+
if ('version' in data) {
/**
* Autoincrementing version identifier updated during substantial record changes
@@ -204,14 +216,19 @@ class ApplicationCommand extends Base {
* @property {string} name The name of the command, must be in all lowercase if type is
* {@link ApplicationCommandType.ChatInput}
* @property {Object} [nameLocalizations] The localizations for the command name
- * @property {string} description The description of the command, if type is {@link ApplicationCommandType.ChatInput}
+ * @property {string} description The description of the command,
+ * if type is {@link ApplicationCommandType.ChatInput} or {@link ApplicationCommandType.PrimaryEntryPoint}
* @property {boolean} [nsfw] Whether the command is age-restricted
* @property {Object} [descriptionLocalizations] The localizations for the command description,
- * if type is {@link ApplicationCommandType.ChatInput}
+ * if type is {@link ApplicationCommandType.ChatInput} or {@link ApplicationCommandType.PrimaryEntryPoint}
* @property {ApplicationCommandType} [type=ApplicationCommandType.ChatInput] The type of the command
* @property {ApplicationCommandOptionData[]} [options] Options for the command
* @property {?PermissionResolvable} [defaultMemberPermissions] The bitfield used to determine the default permissions
* a member needs in order to run the command
+ * @property {ApplicationIntegrationType[]} [integrationTypes] Installation contexts where the command is available
+ * @property {InteractionContextType[]} [contexts] Interaction contexts where the command can be used
+ * @property {EntryPointCommandHandlerType} [handler] Whether the interaction is handled by the app's
+ * interactions handler or by Discord.
*/
/**
@@ -395,7 +412,8 @@ class ApplicationCommand extends Base {
this.descriptionLocalizations ?? {},
) ||
!isEqual(command.integrationTypes ?? command.integration_types ?? [], this.integrationTypes ?? []) ||
- !isEqual(command.contexts ?? [], this.contexts ?? [])
+ !isEqual(command.contexts ?? [], this.contexts ?? []) ||
+ ('handler' in command && command.handler !== this.handler)
) {
return false;
}
diff --git a/packages/discord.js/src/structures/BaseInteraction.js b/packages/discord.js/src/structures/BaseInteraction.js
index 1665395a5e22..410ac36aadb5 100644
--- a/packages/discord.js/src/structures/BaseInteraction.js
+++ b/packages/discord.js/src/structures/BaseInteraction.js
@@ -224,6 +224,16 @@ class BaseInteraction extends Base {
);
}
+ /**
+ * Indicates whether this interaction is a {@link PrimaryEntryPointCommandInteraction}
+ * @returns {boolean}
+ */
+ isPrimaryEntryPointCommand() {
+ return (
+ this.type === InteractionType.ApplicationCommand && this.commandType === ApplicationCommandType.PrimaryEntryPoint
+ );
+ }
+
/**
* Indicates whether this interaction is a {@link MessageComponentInteraction}
* @returns {boolean}
diff --git a/packages/discord.js/src/structures/CommandInteraction.js b/packages/discord.js/src/structures/CommandInteraction.js
index 32b5fb3f77a1..05a90422f692 100644
--- a/packages/discord.js/src/structures/CommandInteraction.js
+++ b/packages/discord.js/src/structures/CommandInteraction.js
@@ -152,6 +152,7 @@ class CommandInteraction extends BaseInteraction {
editReply() {}
deleteReply() {}
followUp() {}
+ launchActivity() {}
showModal() {}
awaitModalSubmit() {}
}
diff --git a/packages/discord.js/src/structures/MessageComponentInteraction.js b/packages/discord.js/src/structures/MessageComponentInteraction.js
index 7b0d6b6b6acc..296451d84259 100644
--- a/packages/discord.js/src/structures/MessageComponentInteraction.js
+++ b/packages/discord.js/src/structures/MessageComponentInteraction.js
@@ -98,6 +98,7 @@ class MessageComponentInteraction extends BaseInteraction {
followUp() {}
deferUpdate() {}
update() {}
+ launchActivity() {}
showModal() {}
awaitModalSubmit() {}
}
diff --git a/packages/discord.js/src/structures/ModalSubmitInteraction.js b/packages/discord.js/src/structures/ModalSubmitInteraction.js
index 5362bb2e6bf3..85ae1df1ce9b 100644
--- a/packages/discord.js/src/structures/ModalSubmitInteraction.js
+++ b/packages/discord.js/src/structures/ModalSubmitInteraction.js
@@ -118,6 +118,7 @@ class ModalSubmitInteraction extends BaseInteraction {
followUp() {}
deferUpdate() {}
update() {}
+ launchActivity() {}
}
InteractionResponses.applyToClass(ModalSubmitInteraction, 'showModal');
diff --git a/packages/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js b/packages/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js
new file mode 100644
index 000000000000..e757e19c3b1a
--- /dev/null
+++ b/packages/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js
@@ -0,0 +1,11 @@
+'use strict';
+
+const { CommandInteraction } = require('./CommandInteraction.js');
+
+/**
+ * Represents a primary entry point command interaction.
+ * @extends {CommandInteraction}
+ */
+class PrimaryEntryPointCommandInteraction extends CommandInteraction {}
+
+exports.PrimaryEntryPointCommandInteraction = PrimaryEntryPointCommandInteraction;
diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js
index 834e3e65f698..c32b82bf0180 100644
--- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js
+++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js
@@ -51,6 +51,12 @@ class InteractionResponses {
* @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
*/
+ /**
+ * Options for launching activity in response to a {@link BaseInteraction}
+ * @typedef {Object} LaunchActivityOptions
+ * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
+ */
+
/**
* Options for showing a modal in response to a {@link BaseInteraction}
* @typedef {Object} ShowModalOptions
@@ -265,6 +271,25 @@ class InteractionResponses {
return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined;
}
+ /**
+ * Launches this application's activity, if enabled
+ * @param {LaunchActivityOptions} [options={}] Options for launching the activity
+ * @returns {Promise}
+ */
+ async launchActivity({ withResponse } = {}) {
+ if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
+ const response = await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
+ query: makeURLSearchParams({ with_response: withResponse ?? false }),
+ body: {
+ type: InteractionResponseType.LaunchActivity,
+ },
+ auth: false,
+ });
+ this.replied = true;
+
+ return withResponse ? new InteractionCallbackResponse(this.client, response) : undefined;
+ }
+
/**
* Shows a modal component
* @param {ModalBuilder|ModalComponentData|APIModalInteractionResponseCallbackData} modal The modal to show
@@ -328,6 +353,7 @@ class InteractionResponses {
'followUp',
'deferUpdate',
'update',
+ 'launchActivity',
'showModal',
'awaitModalSubmit',
];
diff --git a/packages/discord.js/src/util/APITypes.js b/packages/discord.js/src/util/APITypes.js
index 6a38ed450bef..c40af6c289cc 100644
--- a/packages/discord.js/src/util/APITypes.js
+++ b/packages/discord.js/src/util/APITypes.js
@@ -325,6 +325,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/EntitlementType}
*/
+/**
+ * @external EntryPointCommandHandlerType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/EntryPointCommandHandlerType}
+ */
+
/**
* @external ForumLayoutType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ForumLayoutType}
diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts
index 340ecd5adab1..5e209fcd9d4b 100644
--- a/packages/discord.js/typings/index.d.ts
+++ b/packages/discord.js/typings/index.d.ts
@@ -159,6 +159,7 @@ import {
VoiceChannelEffectSendAnimationType,
GatewayVoiceChannelEffectSendDispatchData,
RESTAPIPoll,
+ EntryPointCommandHandlerType,
} from 'discord-api-types/v10';
import { ChildProcess } from 'node:child_process';
import { Stream } from 'node:stream';
@@ -406,6 +407,7 @@ export class ApplicationCommand extends Base {
public get manager(): ApplicationCommandManager;
public id: Snowflake;
public integrationTypes: ApplicationIntegrationType[] | null;
+ public handler: EntryPointCommandHandlerType | null;
public name: string;
public nameLocalizations: LocalizationMap | null;
public nameLocalized: string | null;
@@ -508,23 +510,6 @@ export type BooleanCache = Cached extends 'cached' ? t
export abstract class CommandInteraction extends BaseInteraction {
public type: InteractionType.ApplicationCommand;
public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
- public options: Omit<
- CommandInteractionOptionResolver,
- | 'getMessage'
- | 'getFocused'
- | 'getMentionable'
- | 'getRole'
- | 'getUser'
- | 'getMember'
- | 'getAttachment'
- | 'getNumber'
- | 'getInteger'
- | 'getString'
- | 'getChannel'
- | 'getBoolean'
- | 'getSubcommandGroup'
- | 'getSubcommand'
- >;
public channelId: Snowflake;
public commandId: Snowflake;
public commandName: string;
@@ -557,6 +542,13 @@ export abstract class CommandInteraction e
public reply(
options: string | MessagePayload | InteractionReplyOptions,
): Promise> | undefined>;
+ public launchActivity(
+ options: LaunchActivityOptions & { withResponse: true },
+ ): Promise>>;
+ public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise;
+ public launchActivity(
+ options?: LaunchActivityOptions,
+ ): Promise> | undefined>;
public showModal(
modal:
| JSONEncodable
@@ -1156,6 +1148,23 @@ export class CommandInteractionOptionResolver extends CommandInteraction {
+ public options: Omit<
+ CommandInteractionOptionResolver,
+ | 'getMessage'
+ | 'getFocused'
+ | 'getMentionable'
+ | 'getRole'
+ | 'getUser'
+ | 'getMember'
+ | 'getAttachment'
+ | 'getNumber'
+ | 'getInteger'
+ | 'getString'
+ | 'getChannel'
+ | 'getBoolean'
+ | 'getSubcommandGroup'
+ | 'getSubcommand'
+ >;
public commandType: ApplicationCommandType.Message | ApplicationCommandType.User;
public targetId: Snowflake;
public inGuild(): this is ContextMenuCommandInteraction<'raw' | 'cached'>;
@@ -1164,6 +1173,15 @@ export class ContextMenuCommandInteraction
private resolveContextMenuOptions(data: APIApplicationCommandInteractionData): CommandInteractionOption[];
}
+export class PrimaryEntryPointCommandInteraction<
+ Cached extends CacheType = CacheType,
+> extends CommandInteraction {
+ public commandType: ApplicationCommandType.PrimaryEntryPoint;
+ public inGuild(): this is PrimaryEntryPointCommandInteraction<'raw' | 'cached'>;
+ public inCachedGuild(): this is PrimaryEntryPointCommandInteraction<'cached'>;
+ public inRawGuild(): this is PrimaryEntryPointCommandInteraction<'raw'>;
+}
+
// tslint:disable-next-line no-empty-interface
export interface DMChannel
extends Omit<
@@ -1779,6 +1797,7 @@ export type Interaction =
| ChatInputCommandInteraction
| MessageContextMenuCommandInteraction
| UserContextMenuCommandInteraction
+ | PrimaryEntryPointCommandInteraction
| SelectMenuInteraction
| ButtonInteraction
| AutocompleteInteraction
@@ -1828,6 +1847,7 @@ export class BaseInteraction extends Base
public isChatInputCommand(): this is ChatInputCommandInteraction;
public isCommand(): this is CommandInteraction;
public isContextMenuCommand(): this is ContextMenuCommandInteraction;
+ public isPrimaryEntryPointCommand(): this is PrimaryEntryPointCommandInteraction;
public isMessageComponent(): this is MessageComponentInteraction;
public isMessageContextMenuCommand(): this is MessageContextMenuCommandInteraction;
public isModalSubmit(): this is ModalSubmitInteraction;
@@ -2199,6 +2219,13 @@ export class MessageComponentInteraction e
public update(
options: string | MessagePayload | InteractionUpdateOptions,
): Promise> | undefined>;
+ public launchActivity(
+ options: LaunchActivityOptions & { withResponse: true },
+ ): Promise>>;
+ public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise;
+ public launchActivity(
+ options?: LaunchActivityOptions,
+ ): Promise> | undefined>;
public showModal(
modal:
| JSONEncodable
@@ -2437,6 +2464,13 @@ export class ModalSubmitInteraction extend
public deferUpdate(
options?: InteractionDeferUpdateOptions,
): Promise> | undefined>;
+ public launchActivity(
+ options: LaunchActivityOptions & { withResponse: true },
+ ): Promise>>;
+ public launchActivity(options?: LaunchActivityOptions & { withResponse?: false }): Promise;
+ public launchActivity(
+ options?: LaunchActivityOptions,
+ ): Promise> | undefined>;
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
public inCachedGuild(): this is ModalSubmitInteraction<'cached'>;
public inRawGuild(): this is ModalSubmitInteraction<'raw'>;
@@ -4576,10 +4610,18 @@ export interface ChatInputApplicationCommandData extends BaseApplicationCommandD
options?: readonly ApplicationCommandOptionData[];
}
+export interface PrimaryEntryPointCommandData extends BaseApplicationCommandData {
+ description?: string;
+ descriptionLocalizations?: LocalizationMap;
+ type: ApplicationCommandType.PrimaryEntryPoint;
+ handler?: EntryPointCommandHandlerType;
+}
+
export type ApplicationCommandData =
| UserApplicationCommandData
| MessageApplicationCommandData
- | ChatInputApplicationCommandData;
+ | ChatInputApplicationCommandData
+ | PrimaryEntryPointCommandData;
export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
type: CommandOptionChannelResolvableType;
@@ -6605,6 +6647,10 @@ export interface ShowModalOptions {
withResponse?: boolean;
}
+export interface LaunchActivityOptions {
+ withResponse?: boolean;
+}
+
export { Snowflake };
export type StageInstanceResolvable = StageInstance | Snowflake;
diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts
index c327afdc02af..4e41a80fd7ee 100644
--- a/packages/discord.js/typings/index.test-d.ts
+++ b/packages/discord.js/typings/index.test-d.ts
@@ -204,6 +204,7 @@ import {
SendableChannels,
PollData,
InteractionCallbackResponse,
+ PrimaryEntryPointCommandInteraction,
GuildScheduledEventRecurrenceRuleOptions,
ThreadOnlyChannel,
PartialPoll,
@@ -1884,6 +1885,11 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
} else if (interaction.inRawGuild()) {
expectAssignable(interaction);
expectType(interaction.component);
@@ -1910,6 +1916,11 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
} else if (interaction.inGuild()) {
expectAssignable(interaction);
expectType(interaction.component);
@@ -1936,6 +1947,11 @@ client.on('interactionCreate', async interaction => {
expectType>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>(interaction.followUp({ content: 'a' }));
+ expectType>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
}
}
@@ -1982,6 +1998,11 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.editReply({ content: 'a' }));
expectType>>(interaction.fetchReply());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
} else if (interaction.inRawGuild()) {
expectAssignable(interaction);
expectType(interaction.guild);
@@ -1999,6 +2020,11 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.editReply({ content: 'a' }));
expectType>>(interaction.fetchReply());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
} else if (interaction.inGuild()) {
expectAssignable(interaction);
expectType(interaction.guild);
@@ -2016,6 +2042,11 @@ client.on('interactionCreate', async interaction => {
expectType>(interaction.editReply({ content: 'a' }));
expectType>(interaction.fetchReply());
expectType>(interaction.followUp({ content: 'a' }));
+ expectType>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
}
}
@@ -2184,6 +2215,84 @@ client.on('interactionCreate', async interaction => {
interaction.options.getMessage('name');
}
+ if (
+ interaction.type === InteractionType.ApplicationCommand &&
+ interaction.commandType === ApplicationCommandType.PrimaryEntryPoint
+ ) {
+ expectType(interaction);
+
+ // @ts-expect-error No options on primary entry point commands
+ interaction.options;
+ if (interaction.inCachedGuild()) {
+ expectAssignable(interaction);
+ expectAssignable(interaction.guild);
+ expectAssignable>(interaction);
+ expectType>>(interaction.reply({ content: 'a', withResponse: true }));
+ expectType>>(interaction.deferReply({ withResponse: true }));
+ expectType>(interaction.deferReply());
+ expectType>(interaction.reply({ content: 'a', withResponse: false }));
+ expectType>(interaction.deferReply({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.reply({ content: 'a', withResponse: booleanValue }),
+ );
+ expectType | undefined>>(
+ interaction.deferReply({ withResponse: booleanValue }),
+ );
+ expectType>>(interaction.editReply({ content: 'a' }));
+ expectType>>(interaction.fetchReply());
+ expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
+ } else if (interaction.inRawGuild()) {
+ expectAssignable(interaction);
+ expectType(interaction.guild);
+ expectType>>(interaction.reply({ content: 'a', withResponse: true }));
+ expectType>>(interaction.deferReply({ withResponse: true }));
+ expectType>(interaction.deferReply());
+ expectType>(interaction.reply({ content: 'a', withResponse: false }));
+ expectType>(interaction.deferReply({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.reply({ content: 'a', withResponse: booleanValue }),
+ );
+ expectType | undefined>>(
+ interaction.deferReply({ withResponse: booleanValue }),
+ );
+ expectType>>(interaction.editReply({ content: 'a' }));
+ expectType>>(interaction.fetchReply());
+ expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType | undefined>>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
+ } else if (interaction.inGuild()) {
+ expectAssignable(interaction);
+ expectType(interaction.guild);
+ expectType>(interaction.reply({ content: 'a', withResponse: true }));
+ expectType>(interaction.deferReply({ withResponse: true }));
+ expectType>(interaction.deferReply());
+ expectType>(interaction.reply({ content: 'a', withResponse: false }));
+ expectType>(interaction.deferReply({ withResponse: false }));
+ expectType>(
+ interaction.reply({ content: 'a', withResponse: booleanValue }),
+ );
+ expectType>(
+ interaction.deferReply({ withResponse: booleanValue }),
+ );
+ expectType>(interaction.editReply({ content: 'a' }));
+ expectType>(interaction.fetchReply());
+ expectType>(interaction.followUp({ content: 'a' }));
+ expectType>(interaction.launchActivity({ withResponse: true }));
+ expectType>(interaction.launchActivity({ withResponse: false }));
+ expectType>(
+ interaction.launchActivity({ withResponse: booleanValue }),
+ );
+ }
+ }
+
if (interaction.isRepliable()) {
expectAssignable(interaction);
interaction.reply('test');
@@ -2212,6 +2321,7 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
} else if (interaction.inRawGuild()) {
expectAssignable(interaction);
expectType(interaction.guild);
@@ -2223,6 +2333,7 @@ client.on('interactionCreate', async interaction => {
expectType>>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>>(interaction.followUp({ content: 'a' }));
+ expectType>>(interaction.launchActivity({ withResponse: true }));
} else if (interaction.inGuild()) {
expectAssignable(interaction);
expectType(interaction.guild);
@@ -2234,6 +2345,7 @@ client.on('interactionCreate', async interaction => {
expectType>(interaction.deferUpdate({ withResponse: true }));
expectType>(interaction.deferUpdate());
expectType>(interaction.followUp({ content: 'a' }));
+ expectType>(interaction.launchActivity({ withResponse: true }));
}
}
});