Support custom avatar URLs with username and add embed color support#224
Support custom avatar URLs with username and add embed color support#224auuruum wants to merge 2 commits into
Conversation
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.
|
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:
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
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) |
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:
embedColorfield toDiscordMessageandDiscordMessageBuilder, along with a builder method to set it. This allows specifying a custom color for each message. [1] [2] [3] [4]SDLinkRelayClientandServerEventsto 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]MessageFormattingconfig to include new color fields (e.g.,serverStartingColor,chatColor, etc.) for each message type, with documentation.Avatar URL customization:
customAvatarServiceconfig andAvatarType.resolvemethod to support{username}as a placeholder in addition to{uuid}for avatar URLs, improving avatar customization for both online and offline modes. [1] [2]resolveinDiscordAuthorto pass both UUID and username as needed. [1] [2]Other: