Command is not registering
i have a issue with register a translated command..
Current code is
Solution:Jump to solution
@Fabi My current suspicion is that you havent setup @sapphire/plugin-i18next properly. Here is a zip with files that are based on the CLI generated template that show what needs to be done
The important parts are:
1. Calling the
/register
of the plugin
2. Configuring the languages for the plugin (see the config in src/index.ts
)...19 Replies
![No description](https://cdn.answeroverflow.com/1217914842900467802/image.png)
Is2g why are application commands failing for literally everyone today @vladdy :stress: :stress: :stress: :stress:
???
wtf happened
everything worked fine for so long and randomly it breaks?
is this a cjs/esm moment??
Nah doubt it. That's been fixed for a while now too.
yeah but why did it randomly break now
after all this time
when it worked FINE
Maybe Discord shitting itself?
For starters, please list all your dependencies @Fabi
this is on sapphire not discord
something strange is happening
are all plugins esm'd yet @Favna if you remember
i know you're out
yes
hm
it works for me
node version diffs?
My thought is that @Fabi hasnt fully set up i18next
doesn't explain the other issues
those are separate and need separate investigation
Solution
@Fabi My current suspicion is that you havent setup @sapphire/plugin-i18next properly. Here is a zip with files that are based on the CLI generated template that show what needs to be done
The important parts are:
1. Calling the
/register
of the plugin
2. Configuring the languages for the plugin (see the config in src/index.ts
)
3. Adding the languages
directory
4. In languages
add the appropriate languages subfolders
5. In those subfolders create the JSON files (ping.json
in your case becaus you references the keys as ping:Something
)
6. Add the appropriate keys in the JSON files, in your case CommandName
and CommandDescription
7. Ensure that TypeScript copies the JSON files when compiling by adding src/**/*.json
to the includes
array as well as enabling compilerOptions.resolveJsonModule
It should be noted that steps 4, 5 and 6 are directly related to the usage of i18next: https://www.i18next.com. By providing i18n you're taking on a big task of understanding how this framework works.I'll look later into it
Other question, related to that:
Can I put a subcommands into multiple files.
Like
/voice lock
own file and /voice unlock
own file