Localizing Command helptext
When providing helptext localizations, they will be loaded automatically when placed in the
YAMDBF Client commandsDir
. Localizations for the base commands can be placed in there as well
as localizations for any custom commands. Like regular localization strings, these can be
spread out across as many files as desired for organizational purposes.
Command helptext localizations are expected to reside in .lang.json
files as the text is
static and doesn't quite work out with the nature of the .lang
format. These files are expected
to be in the format of
{
"commandName": {
"languageName": {
"desc": "Description of the command",
"info": "Extra information for the command",
"usage": "<prefix>commandname"
}
}
}
As many languages as desired can be contained under the same command and as many commands as desired
can be contained in the same file. It's encouraged to use English helptext in the command file itself
for custom commands as commands need at least a base desc
and usage
field to be considered valid
commands and this lines up with the base commands using english helptext.
Base English helptext strings
{
"eval": {
"en_us": {
"desc": "Evaluate provided Javascript code",
"usage": "<prefix>eval <...code>"
}
},
"eval:ts": {
"en_us": {
"desc": "Evaluate provided Typescript code",
"usage": "<prefix>eval:ts <...code>",
"info": "Runs pretty slowly due to having to run diagnostics before compiling. If Typescript is not installed the provided code will be evaluated as Javascript and diagnostics/compilation will be skipped."
}
},
"help": {
"en_us": {
"desc": "Provides information on bot commands",
"usage": "<prefix>help [command]",
"info": "Will DM command help information to the user to keep clutter down in guild channels"
}
},
"ping": {
"en_us": {
"desc": "Pong!",
"usage": "<prefix>ping"
}
},
"reload": {
"en_us": {
"desc": "Reload all custom commands and all events",
"usage": "<prefix>reload"
}
},
"setlang": {
"en_us": {
"desc": "List languages or set bot language",
"usage": "<prefix>setlang [lang]"
}
},
"setprefix": {
"en_us": {
"desc": "Set or check command prefix",
"usage": "<prefix>setprefix [prefix]",
"info": "Prefixes may be 1-10 characters in length and may not include backslashes or backticks. Use \"clear\" to clear the prefix and allow commands to be called without a prefix."
}
},
"shortcuts": {
"en_us": {
"desc": "Configure or list command shortcuts",
"usage": "<prefix>shortcuts ['get'|'set'|'remove'] [name] [...content]",
"info": "Shortcuts allow creating and calling preconfigured command+argument sets, or simple aliases\n\nExample:\n\t<prefix>shortcuts set h help\n\nWhich would set the shortcut \"h\" to call the command \"help\"\n\n\nShortcuts also allow substitution tokens for argument interpolation.\n\nExample:\n\t<prefix>shortcuts set add eval %s + %s\n\nWhich would set the shortcut \"add\", to add two numbers --\n\"<prefix>add 2 3\", which becomes \"<prefix>eval 2 + 3\"\n\nOf course the eval command is owner-only, but this should give you an idea of how shortcuts work"
}
},
"blacklist": {
"en_us": {
"desc": "Blacklist a user from calling commands",
"usage": "<prefix>blacklist <action> <user> ['global']",
"info": "If global, this will block the user from calling commands in ANY server and DMs"
}
},
"groups": {
"en_us": {
"desc": "Configure or list command groups",
"usage": "<prefix>groups ['enable'|'on'|'disable'|'off'] [...group]",
"info": "A '*' denotes a disabled group when listing all command groups."
}
},
"limit": {
"en_us": {
"desc": "Limit commands to certain roles",
"usage": "<prefix>limit <command> <roles, ...> | <prefix>limit <'clear'> <command>",
"info": "Multiple roles can be passed to the command as a comma-separated list.\n\nIf a role is unable to be found and you know it exists, it could be that there are multiple roles\ncontaining the given role name search text. Consider refining your search, or using an @mention for\nthe role you want to use.\n\nLimiting a command will add the given roles to set of roles the command is limited to.\n\nUse '<prefix>limit clear <command>' to clear all of the roles a command is limited to.\n\nRemoving individual roles is not possible to keep the command simple to use."
}
}
}