Skip to content

Commit f5727a6

Browse files
committed
Fix setup panel emoji and double-encoded UTF-8 (mojibake)
- SetupCommand: ':black_square_for_button:' is not a valid Discord shortcode, so unconfigured modules rendered as raw text. Use ':black_square_button:' (lines 154, 160). - Fix double-encoded UTF-8 in 5 files where original chars were UTF-8 encoded, mis-decoded as Windows-1252, then re-saved as UTF-8: SetupCommand:600 -> ? ? ? UpdateChecker:139 -> em-dash StartupBanner:21,55 -> em-dash (guild name / truncate fallback) PlayerProfileBuilder -> middle dot, bullet LeaderboardModule -> em-dash (x2) Compiles cleanly (mvn compile). Zero residual mojibake in src/.
1 parent 2c54757 commit f5727a6

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/main/java/dev/demonz/zdiscord/discord/SetupCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ private void showWizardPanel(SlashCommandInteractionEvent event) {
151151
statusLines.append(":white_check_mark: **").append(entry.getKey())
152152
.append("** -> <#").append(val).append(">\n");
153153
} else {
154-
statusLines.append(":black_square_for_button: ").append(entry.getKey()).append("\n");
154+
statusLines.append(":black_square_button: ").append(entry.getKey()).append("\n");
155155
}
156156
}
157157

158158
int catCount = getCategoriesFromConfig().size();
159159
String catLine = catCount == 0
160-
? ":black_square_for_button: ticket categories (none yet)"
160+
? ":black_square_button: ticket categories (none yet)"
161161
: ":white_check_mark: " + catCount + " ticket categor"
162162
+ (catCount == 1 ? "y" : "ies") + " configured";
163163

@@ -597,7 +597,7 @@ private void showCategoryModal(ButtonInteractionEvent event, String existingId)
597597
modal.addActionRow(TextInput.create("emoji", "Emoji (optional)",
598598
TextInputStyle.SHORT)
599599
.setValue(existing == null || existing.emoji == null ? "" : existing.emoji)
600-
.setPlaceholder("❓ ⚡ 🐛 (single emoji)")
600+
.setPlaceholder("❓ ⚡ 🐛 (single emoji)")
601601
.setRequired(false)
602602
.setMaxLength(8)
603603
.build());

src/main/java/dev/demonz/zdiscord/modules/LeaderboardModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public EmbedBuilder buildLeaderboardEmbed(String stat, int page,
342342
String value = formatStatValue(key, entry.getValue());
343343

344344
sb.append(rank).append(" **").append(playerName).append("**")
345-
.append(" — `").append(value).append("`\n")
345+
.append(" `").append(value).append("`\n")
346346
.append("\u200B \u200B \u200B \u200B ").append(bar).append("\n");
347347
}
348348

@@ -437,7 +437,7 @@ public EmbedBuilder buildFollowerLeaderboardEmbed() {
437437
String rank = i < 3 ? MEDALS[i] : "**" + (i + 1) + ".**";
438438
String bar = buildProgressBar(entry.getValue(), maxVal);
439439
sb.append(rank).append(" **").append(name).append("**")
440-
.append(" — `").append(entry.getValue()).append(" followers`\n")
440+
.append(" `").append(entry.getValue()).append(" followers`\n")
441441
.append("\u200B \u200B \u200B \u200B ").append(bar).append("\n");
442442
}
443443
embed.setDescription(sb.toString());

src/main/java/dev/demonz/zdiscord/util/PlayerProfileBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public static EmbedBuilder toEmbed(ZDiscord plugin, Profile profile, String requ
5454
"profile.embed.color", "#9B59B6");
5555

5656
EmbedBuilder embed = new EmbedBuilder()
57-
.setAuthor(profile.name + " · Player profile",
57+
.setAuthor(profile.name + " · Player profile",
5858
"https://namemc.com/profile/" + profile.uuid,
5959
avatarSmall)
6060
.setThumbnail(avatarLarge)
6161
.setColor(ColorUtil.parseHex(color))
6262
.setFooter("Requested by " + requestedBy
63-
+ " • ZDiscord v" + plugin.getDescription().getVersion(), null)
63+
+ " ZDiscord v" + plugin.getDescription().getVersion(), null)
6464
.setTimestamp(Instant.now());
6565

6666

src/main/java/dev/demonz/zdiscord/util/StartupBanner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void print(ZDiscord plugin, long startupMs) {
1818
String platform = plugin.getPlatformAdapter().getPlatformName();
1919

2020
String botName = "Not connected";
21-
String guildName = "—";
21+
String guildName = "";
2222
if (plugin.getBotManager() != null && plugin.getBotManager().isConnected()) {
2323
botName = plugin.getBotManager().getJda().getSelfUser().getName();
2424
var guild = plugin.getBotManager().getGuild();
@@ -52,7 +52,7 @@ private static String pad(String text) {
5252

5353
private static String truncate(String text, int maxLen) {
5454
if (text == null) {
55-
return "—";
55+
return "";
5656
}
5757
if (text.length() <= maxLen) {
5858
return text;

src/main/java/dev/demonz/zdiscord/util/UpdateChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void postSilentDiscordNotice(String currentVersion) {
136136
EmbedBuilder embed = new EmbedBuilder()
137137
.setTitle(":arrows_counterclockwise: ZDiscord update available")
138138
.setDescription("A new version of **ZDiscord** is available. "
139-
+ "No action is required — this is a quiet notice.\n\n"
139+
+ "No action is required this is a quiet notice.\n\n"
140140
+ "Installed: `v" + currentVersion + "`\n"
141141
+ "Latest: `v" + latestVersion + "`")
142142
.setColor(0xF1C40F)

0 commit comments

Comments
 (0)