From d623f474107339b45ccd36479811e0282688491e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 22 Aug 2021 22:05:57 +0200 Subject: [PATCH] Fixup async Chat problems --- src/de/steamwar/bungeecore/bot/events/SchematicsManager.java | 2 +- .../steamwar/bungeecore/bot/listeners/IngameChatListener.java | 2 +- .../bungeecore/bot/listeners/ServerTeamChatListener.java | 2 +- src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/de/steamwar/bungeecore/bot/events/SchematicsManager.java b/src/de/steamwar/bungeecore/bot/events/SchematicsManager.java index 4052d84..64809e1 100644 --- a/src/de/steamwar/bungeecore/bot/events/SchematicsManager.java +++ b/src/de/steamwar/bungeecore/bot/events/SchematicsManager.java @@ -67,7 +67,7 @@ public class SchematicsManager { if (message == null) { message = textChannel.sendMessage(messageBuilder.build()).complete(); } else { - message.editMessage(messageBuilder.build()).complete(); + message.editMessage(messageBuilder.build()).queue(); } } } diff --git a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java index 626a26e..ce635f3 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/IngameChatListener.java @@ -63,6 +63,6 @@ public class IngameChatListener extends BasicDiscordListener { assert textChannel != null; MessageBuilder messageBuilder = new MessageBuilder(); messageBuilder.append(message.replace("&", "").replace("@everyone", "`@everyone`").replace("@here", "`@here`").replaceAll("<[@#]!?\\d+>", "`$0`")); - textChannel.sendMessage(messageBuilder.build()).complete(); + textChannel.sendMessage(messageBuilder.build()).queue(); } } diff --git a/src/de/steamwar/bungeecore/bot/listeners/ServerTeamChatListener.java b/src/de/steamwar/bungeecore/bot/listeners/ServerTeamChatListener.java index 432c287..0f82673 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/ServerTeamChatListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/ServerTeamChatListener.java @@ -54,6 +54,6 @@ public class ServerTeamChatListener extends BasicDiscordListener { assert textChannel != null; MessageBuilder messageBuilder = new MessageBuilder(); messageBuilder.append(message.replace("&", "")); - textChannel.sendMessage(messageBuilder.build()).complete(); + textChannel.sendMessage(messageBuilder.build()).queue(); } } diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java index a01121b..b4b4261 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java @@ -49,7 +49,7 @@ public class DiscordSchemAlert { MessageBuilder messageBuilder = new MessageBuilder(); messageBuilder.setEmbeds(builder.build()); try { - dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).complete(); + dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).queue(); } catch (Exception e) { // Ignored } @@ -70,7 +70,7 @@ public class DiscordSchemAlert { messageBuilder.setEmbeds(builder.build()); messageBuilder.setActionRows(ActionRow.of(Button.success("tada", Emoji.fromUnicode("U+1F389")))); try { - dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).complete(); + dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).queue(); } catch (Exception e) { // Ignored }