Multi language Bot

Hey everyone,
I’m working on a Discord bot with multiple commands that supports multiple languages. Each server can set its own language, and I need to ensure that commands and other content are displayed in the correct language.

Currently, after every relevant action (e.g., an unban), I call deployCommands({ guildId }) to update the commands with the right translations.

🔹 My bot has multiple commands (unban is just an example).
🔹 Issue: deployCommands({ guildId }) is triggered every time an action happens → This leads to a lot of API requests, especially when the bot is on many servers.
🔹 Goal: I want to update commands less frequently while still ensuring they are in the correct language.

My questions:
1️⃣ Is there a more efficient way to handle language-dependent commands without redeploying after every action?
2️⃣ Has anyone worked with batching or delayed deployments for multilingual bots?
3️⃣ How can I make sure commands update when a language change happens, but without unnecessary redeployments?

I’d really appreciate any advice! 😊🙏

export async function deployCommands({ guildId }: DeployCommandsProps) {
  try {
    console.log(
      `Started refreshing application (/) commands for guild ${guildId}.`
    );

    const commandsData = await Promise.all(
      Object.values(commands).map((command) => command.getCommandData(guildId))
    );

    await rest.put(
      Routes.applicationGuildCommands(config.DISCORD_CLIENT_ID!, guildId),
      { body: commandsData }
    );

    console.log(
      `Successfully reloaded application (/) commands for guild ${guildId}.`
    );
  } catch (error) {
    console.error("Error deploying commands:", error);
  }
}
Was this page helpful?
Multi language Bot - discord.js - Imagine ❄