style: run format:apply
This commit is contained in:
+15
-14
@@ -18,6 +18,7 @@ import {
|
||||
import { Logger } from './utils/log';
|
||||
import { config } from './utils/config';
|
||||
import { Bot } from './bot';
|
||||
import { isModule } from './utils/misc';
|
||||
|
||||
export interface Command {
|
||||
name?: string;
|
||||
@@ -51,8 +52,8 @@ export class CommandManager {
|
||||
private categories: Array<CommandCategory> = [];
|
||||
|
||||
/*
|
||||
public
|
||||
*/
|
||||
public
|
||||
*/
|
||||
public constructor(cmdFolder: string) {
|
||||
this.folderPath = path.resolve(__dirname, cmdFolder);
|
||||
this.log = new Logger('Command manager');
|
||||
@@ -95,8 +96,8 @@ export class CommandManager {
|
||||
}
|
||||
|
||||
/*
|
||||
internal
|
||||
*/
|
||||
internal
|
||||
*/
|
||||
private async populateCommands() {
|
||||
if (!fs.existsSync(this.folderPath))
|
||||
throw new Error(`Command directory not found: ${this.folderPath}`);
|
||||
@@ -176,8 +177,8 @@ export class CommandManager {
|
||||
}
|
||||
|
||||
/*
|
||||
cmd parsing
|
||||
*/
|
||||
cmd parsing
|
||||
*/
|
||||
private async attemptLoadCommand(filePath: string): Promise<Command | null> {
|
||||
try {
|
||||
const module = await import(`file://${filePath}`);
|
||||
@@ -193,8 +194,8 @@ export class CommandManager {
|
||||
}
|
||||
|
||||
/*
|
||||
misc functions
|
||||
*/
|
||||
misc functions
|
||||
*/
|
||||
private async registerSlashCommands(): Promise<void> {
|
||||
this.log.info('Registering slash commands...');
|
||||
|
||||
@@ -219,8 +220,8 @@ export class CommandManager {
|
||||
}
|
||||
|
||||
/*
|
||||
interaction handling
|
||||
*/
|
||||
interaction handling
|
||||
*/
|
||||
private async executeCommandInteraction(
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
@@ -295,12 +296,12 @@ export class CommandManager {
|
||||
}
|
||||
|
||||
/*
|
||||
event listeners
|
||||
*/
|
||||
event listeners
|
||||
*/
|
||||
private async onInteraction(interaction: BaseInteraction): Promise<void> {
|
||||
/*
|
||||
cmd execution
|
||||
*/
|
||||
cmd execution
|
||||
*/
|
||||
if (interaction.isChatInputCommand())
|
||||
return this.executeCommandInteraction(interaction);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user