New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v5] There are no aliases in the current beta version? #831
Comments
Yeah, because of Discord's new updates regarding bots, all commands in DMB are SlashCommands. Therefore, no aliases like in v4 where there were Context commandss |
Uh basically, we use Slash commands |
Thanks, I'm looking forward to your v5 version |
If possible, can you put the language in a separate section? |
Feel free to look into this awesome article explaining how localization works! |
who wants help to translate the bot 🥂 |
I can do Italian |
I can do Vietnamese |
Well I'll implement it as soon as d.js add that feature discord/discord-api-docs#2313 |
Well turns out it's already added but... not available yet discordjs/discord.js#7765 (comment)
Linked PR: discordjs/discord.js#7766 |
I'll fix the current grammatical errors through each and every folder of the bot |
I can Indonesia |
I can do with Vietnamese :))) I've translate this bot from v4 by forked it. |
chào đồng hương =))) |
Seems this was implemented, or at least there are traces in the code which are usable: Some implementations can be found (but look highly rudimental) in "node_modules\discord.js\src\structures\ApplicationCommand.js" starting at line 246 The data structure for the commands looks like so /**
* Data for creating or editing an application command.
* @typedef {Object} ApplicationCommandData
* @property {string} name The name of the command
* @property {Object<Locale, string>} [nameLocalizations] The localizations for the command name
* @property {string} description The description of the command
* @property {Object<Locale, string>} [descriptionLocalizations] The localizations for the command description
* @property {ApplicationCommandType} [type] The type of the command
* @property {ApplicationCommandOptionData[]} [options] Options for the command
* @property {boolean} [defaultPermission] Whether the command is enabled by default when the app is added to a guild
*/ There is much more investigating to do, but I think this is a good start. |
Repost of what I said on the discord server, Just so everyone can see and keep updated: aliasing is indeed possible through name localizations, however (And I think this may be due to my ignorance in the matter) I don't know if the name localization should be effectively changing the names of the commands according to the selected language options In the interaction class object, for each executed command, there is a set of properties, namely: class Interaction<Cached extends CacheType = CacheType> extends Base {
public locale: string;
public guildLocale: CacheTypeReducer<Cached, string, string, string>;
} Which could come in handy for managing different aliases based on someone's selected region in discord. guildLocale is the property which defines the region in which the server has been centered upon (default server language) EnglishUS = "en-US",
EnglishGB = "en-GB",
Bulgarian = "bg",
ChineseCN = "zh-CN",
ChineseTW = "zh-TW",
Croatian = "hr",
Czech = "cs",
Danish = "da",
Dutch = "nl",
Finnish = "fi",
French = "fr",
German = "de",
Greek = "el",
Hindi = "hi",
Hungarian = "hu",
Italian = "it",
Japanese = "ja",
Korean = "ko",
Lithuanian = "lt",
Norwegian = "no",
Polish = "pl",
PortugueseBR = "pt-BR",
Romanian = "ro",
Russian = "ru",
SpanishES = "es-ES",
Swedish = "sv-SE",
Thai = "th",
Turkish = "tr",
Ukrainian = "uk",
Vietnamese = "vi" These are the available locales (check Discord Developer Portal) Each one of those can be interpreted as an object property as well, not just string, for example: "en-US"?: string;
"en-GB"?: string;
bg?: string;
"zh-CN"?: string;
"zh-TW"?: string;
hr?: string;
etc... the locales can be set through methods, of the discord.js builders package, or directly through property manipulation. However, I've yet to test which of the two is most effective and/or usable command.setLocalizedNames({
'en-GB': 'test',
'pt-BR': 'teste',
}) and module.exports = {
name: "test",
description: "test command",
name_localizations: {
it: "prova",
},
description_localizations: {
it: "commando di prova",
},
run: async(...) => {...}
} |
as the title currently no aliases?
The text was updated successfully, but these errors were encountered: