Skip to content

Commit c08aa9b

Browse files
committed
cleanup imports
1 parent 351564a commit c08aa9b

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

apps/test-bot/src/app/commands/(general)/+ping.middleware.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Logger, type MiddlewareContext, stopMiddlewares } from 'commandkit';
22

33
export function beforeExecute(ctx: MiddlewareContext) {
4-
Logger.info(
5-
`Command-scoped middleware: ${ctx.commandName} will be executed!`,
6-
);
7-
8-
// Logger.info(`Command-scoped middleware: ${ctx.commandName} will be stopped!`);
94
// Logger.info(
10-
// 'None of the other beforeExecute middlewares are supposed to be executed',
5+
// `Command-scoped middleware: ${ctx.commandName} will be executed!`,
116
// );
12-
// stopMiddlewares();
7+
8+
Logger.info(`Command-scoped middleware: ${ctx.commandName} will be stopped!`);
9+
Logger.info(
10+
'None of the other beforeExecute middlewares are supposed to be executed',
11+
);
12+
stopMiddlewares();
1313
}
1414

1515
export function afterExecute(ctx: MiddlewareContext) {

apps/test-bot/src/app/commands/(general)/ping.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
MessageCommandContext,
1414
stopMiddlewares,
1515
Logger,
16+
after,
1617
} from 'commandkit';
1718

1819
export const command: CommandData = {
@@ -101,6 +102,7 @@ export async function chatInput({
101102
message.edit({ components: [row] });
102103
});
103104

104-
Logger.debug('calling stopMiddlewares');
105-
stopMiddlewares();
105+
after(() => {
106+
Logger.debug('after called in ping');
107+
});
106108
}

packages/commandkit/src/app/commands/Context.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
import {
22
AutocompleteInteraction,
3+
Awaitable,
34
ChatInputCommandInteraction,
4-
MessageContextMenuCommandInteraction,
5-
Message,
6-
Locale,
7-
Interaction,
8-
UserContextMenuCommandInteraction,
95
Client,
10-
Awaitable,
116
Guild,
7+
Interaction,
8+
Locale,
9+
Message,
10+
MessageContextMenuCommandInteraction,
1211
TextBasedChannel,
12+
UserContextMenuCommandInteraction,
1313
} from 'discord.js';
1414
import { CommandKit } from '../../commandkit';
15-
import {
16-
MessageCommandOptions,
17-
MessageCommandParser,
18-
} from './MessageCommandParser';
19-
import { CommandKitEnvironment } from '../../context/environment';
2015
import { GenericFunction, getContext } from '../../context/async-context';
21-
import { stopMiddlewares, redirect } from '../interrupt/signals';
16+
import { CommandKitEnvironment } from '../../context/environment';
2217
import {
2318
LoadedCommand,
2419
ResolvableCommand,
2520
RunCommand,
2621
} from '../handlers/AppCommandHandler';
27-
import { CommandKitErrorCodes } from '../../utils/error-codes';
22+
import { redirect } from '../interrupt/signals';
23+
import {
24+
MessageCommandOptions,
25+
MessageCommandParser,
26+
} from './MessageCommandParser';
2827

2928
/**
3029
* Enumeration of different command execution modes supported by CommandKit.

0 commit comments

Comments
 (0)