Skip to content

Commit

Permalink
fix: Updatei18n button label for blacklist and fix invisible color hex
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Dec 18, 2023
1 parent 8790782 commit d3c8e69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/commands/context-menu/blacklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class Blacklist extends BaseCommand {
.addArgs('u=1')
.toString(),
)
.setLabel(t({ phrase: 'blacklist.components.user', locale }))
.setLabel(t({ phrase: 'blacklist.button.user', locale }))
.setStyle(ButtonStyle.Secondary)
.setEmoji('👤'),
new ButtonBuilder()
Expand All @@ -86,7 +86,7 @@ export default class Blacklist extends BaseCommand {
.addArgs('s=1')
.toString(),
)
.setLabel(t({ phrase: 'blacklist.components.user', locale }))
.setLabel(t({ phrase: 'blacklist.button.user', locale }))
.setStyle(ButtonStyle.Secondary)
.setEmoji('🏠'),
);
Expand Down
5 changes: 3 additions & 2 deletions src/managers/CommandManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ export default class CommandManager extends Factory {
await this.loadCommandFiles(filePath);
}

// If the item is a .js file, read its contents
else if (file.endsWith('.js') && file !== 'BaseCommand.js') {
const imported = await import(importPrefix + filePath);
const command = new imported.default();

// if the command extends BaseCommand (ie. its not a subcommand), add it to the commands map
// if the command extends BaseCommand (ie. is not a subcommand), add it to the commands map
if (Object.getPrototypeOf(command.constructor) === BaseCommand) {
commandsMap.set(command.data.name, command);
}
Expand All @@ -164,7 +163,9 @@ export default class CommandManager extends Factory {
access(subcommandFile, constants.F_OK, async (err) => {
if (err || file === 'index.js') return;

// get the parent command class from the subcommand
const parentCommand = Object.getPrototypeOf(command.constructor);
// set the subcommand class to the parent command's subcommands map
parentCommand.subcommands.set(file.replace('.js', ''), command);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export const colors = {
'NotQuiteBlack',
'Random',
] as (keyof typeof Colors)[],
interchatBlue: '#5CB5F9' as HexColorString,
invisible: '#2F3136' as HexColorString,
interchatBlue: '#58b9ff' as HexColorString,
invisible: '#2b2d31' as HexColorString,
christmas: ['#00B32C', '#D6001C', '#FFFFFF'] as HexColorString[],
} as const;

0 comments on commit d3c8e69

Please sign in to comment.