Skip to content

Commit 3a887eb

Browse files
fix(types): allow CommandbuilderType to return all valid builder variants
1 parent dfe8d67 commit 3a887eb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "discord.https",
3-
"version": "3.0.11",
3+
"version": "3.0.12",
44
"description": "Discord.https is a modular library for building and managing Discord HTTP interactions with the Discord API. It provides tools for routing and managing interaction efficiently.",
55
"main": "./dist/index.js",
66
"type": "module",

src/interactionRouter/internal.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ import type Client from "../index.js";
6565

6666
import {
6767
SlashCommandBuilder,
68+
type SlashCommandOptionsOnlyBuilder,
69+
type SlashCommandSubcommandsOnlyBuilder,
70+
type SlashCommandSubcommandBuilder,
71+
type SlashCommandSubcommandGroupBuilder,
6872
ContextMenuCommandBuilder,
6973
} from "@discordjs/builders";
7074

@@ -211,7 +215,12 @@ export interface RouteStack {
211215

212216
export type CommandbuilderType = (
213217
builder: SlashCommandBuilder
214-
) => SlashCommandBuilder;
218+
) =>
219+
| SlashCommandBuilder
220+
| SlashCommandOptionsOnlyBuilder
221+
| SlashCommandSubcommandsOnlyBuilder
222+
| SlashCommandSubcommandBuilder
223+
| SlashCommandSubcommandGroupBuilder;
215224

216225
export type userContextCommandBuilderType = (
217226
builder: ReturnType<typeof userContextCommandBuilder>

0 commit comments

Comments
 (0)