Skip to content

Commit

Permalink
chore(commands): improve update metadata logging
Browse files Browse the repository at this point in the history
  • Loading branch information
NedcloarBR committed Sep 1, 2024
1 parent 5be3245 commit d26b493
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/modules/commands/Commands.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import {
CommandPermissionsKey,
type CommandPermissionsOptions,
} from "@/common/decorators";
import {
CommandConfig,
CommandConfigKey,
CommandConfigOptions,
} from "@/common/decorators/";
import {
Injectable,
Logger,
Expand Down Expand Up @@ -48,7 +53,10 @@ export class CommandsService implements OnApplicationBootstrap {
this.logger.verbose(`${slashCommands.length} SlashCommand (s) explored`);
for (const command of slashCommands) {
this.slashCommandService.remove(command.getName());

const config: CommandConfigOptions = this.reflector.get(
CommandConfigKey,
command.getHandler(),
);
const perms: CommandPermissionsOptions = this.reflector.get(
CommandPermissionsKey,
command.getHandler(),
Expand All @@ -71,7 +79,7 @@ export class CommandsService implements OnApplicationBootstrap {
if (!guilds) return;

this.logger.verbose(
`Updating metadata for SlashCommand : ${command.getName()}`,
`Updating metadata for SlashCommand : [${config.category}] ${command.getName()}`,
);

command.setGuilds(guilds ?? []);
Expand All @@ -84,7 +92,10 @@ export class CommandsService implements OnApplicationBootstrap {
this.logger.verbose(`${subCommands.length} SubCommand (s) explored`);
for (const command of subCommands) {
this.slashCommandService.remove(command.getName());

const config: CommandConfigOptions = this.reflector.get(
CommandConfigKey,
command.getHandler(),
);
const perms: CommandPermissionsOptions = this.reflector.get(
CommandPermissionsKey,
command.getHandler(),
Expand All @@ -107,7 +118,7 @@ export class CommandsService implements OnApplicationBootstrap {
if (!guilds) return;

this.logger.verbose(
`Updating metadata for SubCommand : ${command.getName()}`,
`Updating metadata for SubCommand : [${config.category}] ${command.getName()}`,
);

command.setGuilds(guilds ?? []);
Expand Down

0 comments on commit d26b493

Please sign in to comment.