How to get name&description (default and localized)?
I know about
container.stores.get('commands')
, but I don't want to use decorators. Also, I want to get to the localized variants of the name&description. Any ideas how to do it except for adding i18n sapphire plugin or it's the only option?Solution:Jump to solution
Sapphire Framework
Function: applyLocalizedBuilder() | Sapphire
applyLocalizedBuilder(builder [string] | [string, string]): T
8 Replies
<command>.options.description
still doesn't work for command description not in the decoratorscan you describe what exactly you want because it's not really clear to me what code you're struggling with right now
which decorator for example?
For example, I have this command: (without any decorators)https://gist.github.com/Prosta4okua/317ab84bc669a695510966ba8c10bdf5
And I want to create command
/help
that prints all commands and their descriptions. I want to support two languages. I know how to get locale from user, I know how to set the localization of the application command.
I need a way to receive names and descriptions (including in other localization). Basically something like this: [ {command: {name: 'google', nameLocalization: {'uk': ...}, description: 'Desc', descriptionLocalization: {'uk': 'Desc in uk'}'}, ...]
I have this command:
Solution
Sapphire Framework
Function: applyLocalizedBuilder() | Sapphire
applyLocalizedBuilder(builder [string] | [string, string]): T
it's part of the plugin
other than that
setNameLocalization
takes an object
so if you dont want to use the plugin and just provide the strings in code just use an objectdiscord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
both, that's why it worked without object

Thanks, appreciate it!