Skip to content

Commit 8446380

Browse files
committed
feat: add raw command name fetcher to context
1 parent f00ec13 commit 8446380

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ export class Context<
308308
return this.commandkit.commandHandler.resolveMessageCommandName(maybeAlias);
309309
}
310310

311+
/**
312+
* Gets the invoked command name (could be an alias for message commands)
313+
*/
314+
public get invokedCommandName(): string {
315+
if (this.isInteraction()) {
316+
return this.interaction.commandName;
317+
}
318+
319+
return this.config.messageCommandParser!.getCommand();
320+
}
321+
311322
/**
312323
* Gets the command options based on the execution mode.
313324
*/

0 commit comments

Comments
 (0)