diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java index e1dc9912..07e0527c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java @@ -73,12 +73,13 @@ public class DiscordChannel extends Chatter.PlayerlessChatter { if (getChannel() instanceof TextChannel && message.contains("»")) { String[] strings = message.split("»", 2); String userName = strings[0]; - message = strings[1]; + String sendMessage = strings[1]; strings = userName.split(" "); String ingameName = strings[strings.length - 1]; SteamwarUser user = SteamwarUser.get(ingameName); + System.out.println(ingameName + " " + user); if (user != null) { send(new MessageCreateBuilder() .setContent(message)); @@ -93,12 +94,11 @@ public class DiscordChannel extends Chatter.PlayerlessChatter { } TextChannel textChannel = (TextChannel) getChannel(); - String finalMessage = message; try { textChannel.createWebhook(userName) .setAvatar(Icon.from(avatarUrl.download(128).get())) .onSuccess(webhook -> { - webhook.sendMessage(finalMessage) + webhook.sendMessage(sendMessage) .onSuccess(__ -> { webhook.delete().queue(); }) @@ -107,6 +107,7 @@ public class DiscordChannel extends Chatter.PlayerlessChatter { .queue(); return; } catch (Exception e) { + e.printStackTrace(); // Ignore and send message as normal! } }