From 0d35cef4a4201489028631db6b254b79028aa64c Mon Sep 17 00:00:00 2001 From: Syder <51650493+Syderr@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:14:47 +0200 Subject: [PATCH 1/2] Add stopMiddlewares import to middleware.ts People shouldn't use javascript in 2025, so only imports in the ts snipets --- apps/website/docs/guide/02-commands/08-middlewares.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/website/docs/guide/02-commands/08-middlewares.mdx b/apps/website/docs/guide/02-commands/08-middlewares.mdx index 9f271da4..30b56255 100644 --- a/apps/website/docs/guide/02-commands/08-middlewares.mdx +++ b/apps/website/docs/guide/02-commands/08-middlewares.mdx @@ -76,7 +76,7 @@ the `beforeExecute` function. ```ts title="src/app/commands/+middleware.ts" - import type { MiddlewareContext } from 'commandkit'; + import type { MiddlewareContext, stopMiddlewares } from 'commandkit'; export function beforeExecute(ctx: MiddlewareContext) { if (ctx.interaction.user.id !== '1234567890') { @@ -138,7 +138,7 @@ instance of the `CommandKitErrorCodes.StopMiddlewares` error. ```ts title="src/app/commands/+middleware.ts" - import type { MiddlewareContext } from 'commandkit'; + import type { MiddlewareContext, stopMiddlewares } from 'commandkit'; export function beforeExecute(ctx: MiddlewareContext) { try { From c20707fe061c8a9fb9e2f71a407f637cb02b01fa Mon Sep 17 00:00:00 2001 From: Avraj Date: Thu, 16 Oct 2025 18:51:27 +0300 Subject: [PATCH 2/2] docs: separate type import --- apps/website/docs/guide/02-commands/08-middlewares.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/website/docs/guide/02-commands/08-middlewares.mdx b/apps/website/docs/guide/02-commands/08-middlewares.mdx index 30b56255..3b411577 100644 --- a/apps/website/docs/guide/02-commands/08-middlewares.mdx +++ b/apps/website/docs/guide/02-commands/08-middlewares.mdx @@ -76,7 +76,7 @@ the `beforeExecute` function. ```ts title="src/app/commands/+middleware.ts" - import type { MiddlewareContext, stopMiddlewares } from 'commandkit'; + import { type MiddlewareContext, stopMiddlewares } from 'commandkit'; export function beforeExecute(ctx: MiddlewareContext) { if (ctx.interaction.user.id !== '1234567890') { @@ -138,7 +138,7 @@ instance of the `CommandKitErrorCodes.StopMiddlewares` error. ```ts title="src/app/commands/+middleware.ts" - import type { MiddlewareContext, stopMiddlewares } from 'commandkit'; + import { type MiddlewareContext, stopMiddlewares } from 'commandkit'; export function beforeExecute(ctx: MiddlewareContext) { try {