Skip to content

Commit f8724e2

Browse files
voidsippJRoy
andauthored
Honor the configured Discord private-message format (#6644)
### Information This PR fixes #6641. ### Details **Proposed fix:** Read the private-message format from `messages.pms-to-discord`, matching the shipped config. The settings loader currently reads `messages.private-chat` instead, so a custom format is ignored and the default `[SocialSpy]` text is used. Added settings tests that load real YAML files and check the custom format, default fallback and reload, including placeholders and apostrophes. The Discord module now includes the core project on its test classpath. **Environments tested:** OS: Windows Java version: Temurin 25.0.4.1+1 - [ ] Most recent Paper version - [ ] CraftBukkit/Spigot/Paper 1.12.2 - [ ] CraftBukkit 1.8.8 The full Gradle build passes, including the new settings tests and Checkstyle. Live Paper/Discord relay testing was not performed. **Demonstration:** The regression loads this configuration: ```yaml messages: pms-to-discord: "[Privado] {sender-displayname} -> {receiver-displayname}: {message}" ``` Before the fix, the actual settings loader produces `[SocialSpy] sender -> receiver: Hello`. After the fix, it produces `[Privado] Sender -> Receiver: Hello`. The missing-key control keeps the existing default. --------- Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
1 parent e70bdb8 commit f8724e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎EssentialsDiscord/src/main/java/net/essentialsx/discord/DiscordSettings.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ public void reloadConfig() {
600600
"username", "displayname", "controllername", "controllerdisplayname", "reason");
601601
kickFormat = generateMessageFormat(getFormatString("kick"), "{displayname} was kicked with reason: {reason}", false,
602602
"username", "displayname", "reason");
603-
pmToDiscordFormat = generateMessageFormat(getFormatString("private-chat"), "[SocialSpy] {sender-username} -> {receiver-username}: {message}", false,
603+
pmToDiscordFormat = generateMessageFormat(getFormatString("pms-to-discord"), "[SocialSpy] {sender-username} -> {receiver-username}: {message}", false,
604604
"sender-username", "sender-displayname", "receiver-username", "receiver-displayname", "message");
605605

606606
plugin.onReload();

0 commit comments

Comments
 (0)