Skip to content

Commit 18c8ae9

Browse files
committed
refactor: use strictObject and add missing type
1 parent f4fcc4f commit 18c8ae9

File tree

1 file changed

+3
-1
lines changed
  • packages/builders/src/interactions/commands/chatInput

1 file changed

+3
-1
lines changed

packages/builders/src/interactions/commands/chatInput/Assertions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
ApplicationIntegrationType,
33
InteractionContextType,
44
ApplicationCommandOptionType,
5+
ApplicationCommandType,
56
} from 'discord-api-types/v10';
67
import { z } from 'zod';
78
import { localeMapPredicate, memberPermissionsPredicate } from '../../../Assertions.js';
@@ -163,7 +164,7 @@ export const chatInputCommandSubcommandGroupPredicate = z.object({
163164
options: z.array(chatInputCommandSubcommandPredicate).min(1).max(25),
164165
});
165166

166-
export const chatInputCommandPredicate = z.object({
167+
export const chatInputCommandPredicate = z.strictObject({
167168
...sharedNameAndDescriptionPredicate.shape,
168169
contexts: z.array(z.enum(InteractionContextType)).optional(),
169170
default_member_permissions: memberPermissionsPredicate.optional(),
@@ -175,4 +176,5 @@ export const chatInputCommandPredicate = z.object({
175176
z.array(z.union([chatInputCommandSubcommandPredicate, chatInputCommandSubcommandGroupPredicate])).max(25),
176177
])
177178
.optional(),
179+
type: z.literal(ApplicationCommandType.ChatInput).optional(),
178180
});

0 commit comments

Comments
 (0)