Skip to content

Commit

Permalink
fix: Reset before append text
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-art committed Feb 28, 2024
1 parent 53484dc commit e64d60e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/altart/telegrambridge/TelegramBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void reply(String uuid, String text) {
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);
for (Player player : Bukkit.getOnlinePlayers()) {
if (player.hasPermission(Permissions.RECEIVE.getString())) {
Expand Down Expand Up @@ -117,6 +118,7 @@ public void onMessage(Message message) {
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.reset();
componentBuilder.append(Format.string(TelegramBridge.config.messages_format_chat, values));
if (player.hasPermission(Permissions.REPLY_COMMAND.getString())) {
Integer messageId = message.getMessageId();
Expand Down

0 comments on commit e64d60e

Please sign in to comment.