Discord Bridge banner
Discord Bridge icon

Discord Bridge

This mod should connect to a discord bot. Allowing messages to be sent Server -> Discord and Discord -> Server The user should be able to give a discord bot...

00
hytaleServer2026.1mod

Discord Bridge

  • The mod links the server to a Discord bot: chat, join/leave, and lifecycle messages are mirrored to configured Discord text channels, and chat channels relay back into the server.
  • Configuration lives in the mod data folder as config.json; it is created on first run with placeholders. Key fields include botToken, guildId, channels (all, chat, joinsLeaves, startStop lists), commandUsers (Discord user IDs allowed to run commands), commandPrefix (defaults to !), toggle flags relayDiscordToGame/relayGameToDiscord, and message format strings.
  • Routing rules: chat messages go to all + chat channels; joins/leaves go to all + joinsLeaves; start/stop announcements go to all + startStop. Discord messages in chat channels echo to in-game chat; attachments are appended as URLs.
  • Admin commands: messages in chat channels starting with the prefix run as console commands when the sender's Discord ID is listed in commandUsers. Responses are posted back to Discord.
  • Implementation details: dependencies are shaded into the jar (JDA, Gson, SLF4J simple). The bot waits for Discord readiness before sending; if the config is incomplete or IDs are invalid, it logs a warning and skips connecting.
  • Limitations: the Discord bot must have the Message Content intent enabled; only text channels are supported; invalid or missing channel/guild IDs stop Discord connectivity; commands execute with console permissions, so restrict commandUsers carefully.