Skip to content

Commit

Permalink
fix: Fix the away to reset text
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-art committed Mar 1, 2024
1 parent e64d60e commit 25fc38d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/altart/telegrambridge/TelegramBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public void reply(String uuid, String text) {
String message = messageInfo.message;
ComponentBuilder componentBuilder = new ComponentBuilder();
HashMap<String, String> values = makeMessageMap(username, normalizeReply(message));
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_reply, values)).event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(message)));
componentBuilder.reset();
componentBuilder.append(text);
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_reply, values));
componentBuilder.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(message)));
componentBuilder.append(text, ComponentBuilder.FormatRetention.NONE);
for (Player player : Bukkit.getOnlinePlayers()) {
if (player.hasPermission(Permissions.RECEIVE.getString())) {
player.spigot().sendMessage(componentBuilder.create());
Expand Down Expand Up @@ -116,10 +116,10 @@ public void onMessage(Message message) {
String replyToUsername = replyToMessage.getFrom().getUserName();
String replyToText = replyToMessage.getText();
HashMap<String, String> replyValues = makeMessageMap(replyToUsername, normalizeReply(replyToText));
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_reply, replyValues)).event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(replyToText)));
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_reply, replyValues));
componentBuilder.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(replyToText)));
}
componentBuilder.reset();
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_chat, values));
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_chat, values), ComponentBuilder.FormatRetention.NONE);
if (player.hasPermission(Permissions.REPLY_COMMAND.getString())) {
Integer messageId = message.getMessageId();
String chatId = message.getChatId().toString();
Expand Down

0 comments on commit 25fc38d

Please sign in to comment.