Skip to content

Support custom avatar URLs with username and add embed color support#224

Open
auuruum wants to merge 2 commits into
hypherionmc:universalfrom
BebraLand:universal
Open

Support custom avatar URLs with username and add embed color support#224
auuruum wants to merge 2 commits into
hypherionmc:universalfrom
BebraLand:universal

Conversation

@auuruum

@auuruum auuruum commented Jun 9, 2026

Copy link
Copy Markdown

This pull request adds support for customizable embed colors for various Discord messages sent by the application, allowing users to specify colors for different message types via configuration. It also enhances avatar URL customization by supporting both player UUID and username placeholders. These changes improve the flexibility and appearance of Discord integrations.

Embed color customization:

  • Added an embedColor field to DiscordMessage and DiscordMessageBuilder, along with a builder method to set it. This allows specifying a custom color for each message. [1] [2] [3] [4]
  • Updated the embed construction logic to use the specified embed color if provided, with a helper method to handle color parsing. [1] [2] [3]
  • Modified message sending in SDLinkRelayClient and ServerEvents to set the embed color for chat, join, leave, death, advancement, server lifecycle, and command messages using the new configuration options. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Extended MessageFormatting config to include new color fields (e.g., serverStartingColor, chatColor, etc.) for each message type, with documentation.

Avatar URL customization:

  • Updated the customAvatarService config and AvatarType.resolve method to support {username} as a placeholder in addition to {uuid} for avatar URLs, improving avatar customization for both online and offline modes. [1] [2]
  • Refactored usages of resolve in DiscordAuthor to pass both UUID and username as needed. [1] [2]

Other:

  • Incremented the configuration version to 38 to reflect the new options.

auuruum added 2 commits June 9, 2026 14:43
Allow custom avatar service URLs to include a {username} placeholder. Change AvatarType.resolve to accept a username and replace {username} for CUSTOM avatars, while keeping existing {uuid} replacement for other types. Update DiscordAuthor.of and setPlayerAvatar to pass the username when resolving avatars, and update ChatSettingsConfig comment to document the new {username} substitution.
Introduce embed color support for Discord messages: add embedColor field to DiscordMessage and DiscordMessageBuilder (with embedColor(String) API) and centralize color parsing in a new setEmbedColor helper that accepts #prefixed or plain hex and falls back to defaults. Add configurable color fields to MessageFormatting for various events (server start/stop, chat, join/leave, death, advancements, whitelist, commands) and wire those config values into SDLinkRelayClient and ServerEvents so messages use the configured embed colors. Also bump config version to 38.
@hypherionmc

hypherionmc commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Hi there.

Thank you for your PR. Please note that we are currently NOT accepting any new feature PRs targeting the current universal branch, as stated in #214

Then, just to give some feedback on the actual PR:

Added an embedColor field to DiscordMessage and DiscordMessageBuilder, along with a builder method to set it. This allows specifying a custom color for each message

This can already be done by using a custom embed layout, so seems kind of redundant having it in the config as well? Unless it's for another purpose that I am missing

Avatar

I'm fine with this change. By default we use our own internal service, which also handles mods like Fabric Tailor skins and a couple of other things. When users use their own avatar service, it's fine.

(Side note: If you do want to rather implement any of your changes on the v4 dev branch, please keep in mind that a massive config refactor is incoming, which will completely remove sections of the config, and alter other significantly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants