Tercan
Tercan
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
But I think I will just make it for each user with the locales just as samtino mentioned
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
The responses already go through the Pipeline so there is no Problem only for the Description, Name…
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
Are you german?
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
I’m not sure if my brain isn’t working properly right now, but I haven’t been able to find a solution that doesn’t require redeploying the commands
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
Okay, that’s new to me. If I can solve the translation issue, the problem should be resolved. Thank you for clarifying!
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
The execution of the command isn't the issue; it's more about the building of the command, which needs to be redeployed. Here's an example:
export async function getCommandData(guildId: string) {
const description = await translate("COMMANDS.BAN.DESC", guildId);
const userToBanDesc = await translate("COMMANDS.BAN.OPTIONS.USER", guildId);
const banReasonDesc = await translate("COMMANDS.BAN.OPTIONS.REASON", guildId);
return new SlashCommandBuilder()
.setName("ban")
.setDescription(description)
.addMentionableOption((option) =>
option.setName("user").setDescription(userToBanDesc).setRequired(true)
)
.addStringOption((option) =>
option.setName("reason").setDescription(banReasonDesc).setRequired(false)
)
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.setContexts(InteractionContextType.Guild);
}
export async function getCommandData(guildId: string) {
const description = await translate("COMMANDS.BAN.DESC", guildId);
const userToBanDesc = await translate("COMMANDS.BAN.OPTIONS.USER", guildId);
const banReasonDesc = await translate("COMMANDS.BAN.OPTIONS.REASON", guildId);
return new SlashCommandBuilder()
.setName("ban")
.setDescription(description)
.addMentionableOption((option) =>
option.setName("user").setDescription(userToBanDesc).setRequired(true)
)
.addStringOption((option) =>
option.setName("reason").setDescription(banReasonDesc).setRequired(false)
)
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.setContexts(InteractionContextType.Guild);
}
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
That's the issue I'm facing. I no longer want to do that, but I can't seem to find a solution that achieves the same result without having to redeploy the command after every use.
21 replies
DIAdiscord.js - Imagine an app
Created by Tercan on 3/15/2025 in #djs-questions
Multi language Bot
Thank you for the suggestion! I appreciate it, but that's a bit different from the feature I'm aiming for. I want to allow the server admin to set a global language for their server, which then gets mapped to the guild ID in Redis. After that, for every command or event reaction, I would use a Translation key instead of a plain string. This Translation key, along with the guild ID, is passed to my translation pipeline (i18n) for translation. Once that's done, I would need to redeploy the command. Hope that clarifies things! 😊
21 replies