From 29f8493d9e5349741dd8b9c8f30679e9bd6b9a70 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 10 Sep 2024 12:26:50 -0500 Subject: [PATCH] fix: don't let new entry point commands block --- .changeset/silent-sheep-study.md | 5 +++++ packages/carbon/src/abstracts/BaseCommand.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/silent-sheep-study.md diff --git a/.changeset/silent-sheep-study.md b/.changeset/silent-sheep-study.md new file mode 100644 index 00000000..6cd624ea --- /dev/null +++ b/.changeset/silent-sheep-study.md @@ -0,0 +1,5 @@ +--- +"@buape/carbon": patch +--- + +fix: don't let new entry point commands block diff --git a/packages/carbon/src/abstracts/BaseCommand.ts b/packages/carbon/src/abstracts/BaseCommand.ts index 45d5453d..a07fe450 100644 --- a/packages/carbon/src/abstracts/BaseCommand.ts +++ b/packages/carbon/src/abstracts/BaseCommand.ts @@ -68,6 +68,9 @@ export abstract class BaseCommand { * @internal */ serialize() { + if (this.type === ApplicationCommandType.PrimaryEntryPoint) { + throw new Error("Primary Entry Point commands cannot be serialized") + } // Only chat input commands can have descriptions if (this.type === ApplicationCommandType.ChatInput) { const data: RESTPostAPIApplicationCommandsJSONBody = {