From 6f92ea38d5a5275b7055e38f9de5aa26f53f73e3 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 30 Mar 2025 19:04:32 +0700 Subject: [PATCH] fix: netmsg click to open URL not working --- build-number.txt | 2 +- .../commands/NetMessageCommand.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build-number.txt b/build-number.txt index 581cdc89..05ab9b62 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -2284 \ No newline at end of file +2288 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/NetMessageCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/NetMessageCommand.java index 443e9d8b..357a8e3c 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/NetMessageCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/NetMessageCommand.java @@ -53,15 +53,7 @@ public class NetMessageCommand extends Command { final Component stylizedMessage = LegacyComponentSerializer.legacyAmpersand() .deserialize(rawMessage) - .replaceText(ComponentUtilities.URL_REPLACEMENT_CONFIG) - .clickEvent(ClickEvent.copyToClipboard(rawMessage)) - .hoverEvent( - HoverEvent.showText( - Component - .text("Click here to copy the message to your clipboard") - .color(NamedTextColor.GREEN) - ) - ); + .replaceText(ComponentUtilities.URL_REPLACEMENT_CONFIG); final Component component = Component.translatable( "[%s]%s%s%s› %s", @@ -74,6 +66,14 @@ public class NetMessageCommand extends Command { Component.empty() .append(stylizedMessage) .color(NamedTextColor.GRAY) + .clickEvent(ClickEvent.copyToClipboard(rawMessage)) + .hoverEvent( + HoverEvent.showText( + Component + .text("Click here to copy the message to your clipboard") + .color(NamedTextColor.GREEN) + ) + ) ).color(NamedTextColor.DARK_GRAY); for (Bot eachBot : bots) {