diff --git a/build.gradle b/build.gradle index b37b9131..36fc4187 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ dependencies { implementation 'club.minnced:discord-webhooks:0.5.7' implementation 'ch.qos.logback:logback-classic:1.2.3' implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6' - implementation 'com.github.Steveice10:MCProtocolLib:bf0a6be' + implementation 'com.github.Steveice10:MCProtocolLib:c5e4b66' implementation group: 'mysql', name: 'mysql-connector-java', version: '5.1.13' implementation group: 'org.codehaus.groovy', name: 'groovy-jsr223', version: '3.0.8' } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/AbstractSingleQueryCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/AbstractSingleQueryCommand.java index b167c83e..df2e4856 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/AbstractSingleQueryCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/AbstractSingleQueryCommand.java @@ -59,7 +59,7 @@ public static void sendMultipleMessage(List actions, TextChannel cha } } - channel.sendMessage(preset.getEmbed().build()).setActionRows(Util.of(buttons)).queue((message) -> { + channel.sendMessageEmbeds(preset.getEmbed().build()).setActionRows(Util.of(buttons)).queue((message) -> { ButtonHandler.addListener(userToWait, message, (event) -> { message.delete().queue(); diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/CodeCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/CodeCommand.java index 4c54efb3..04ddd6b3 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/CodeCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/CodeCommand.java @@ -21,10 +21,10 @@ public static void sendHelpMessage(T data, TextChannel ch if (customHead == null) { File actionIcon = Util.fetchMinecraftTextureFile(data.getItem().getMaterial().toUpperCase()); builder.setThumbnail("attachment://" + actionIcon.getName()); - channel.sendMessage(builder.build()).addFile(actionIcon).queue(); + channel.sendMessageEmbeds(builder.build()).addFile(actionIcon).queue(); } else { builder.setThumbnail(customHead); - channel.sendMessage(builder.build()).queue(); + channel.sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/TagsCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/TagsCommand.java index f57dd592..ae3fc2d4 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/TagsCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/codeblock/TagsCommand.java @@ -26,14 +26,14 @@ private static void sendTagMessage(CodeObject data, TextChannel channel) { } else { builder.setTitle("Invalid data!"); builder.setDescription("What you have searched for is not a valid action!"); - channel.sendMessage(builder.build()).queue(); + channel.sendMessageEmbeds(builder.build()).queue(); return; } if (actionData.getTags().length == 0) { builder.setTitle("No tags!"); builder.setDescription("This action does not contain any tags!"); - channel.sendMessage(builder.build()).queue(); + channel.sendMessageEmbeds(builder.build()).queue(); return; } @@ -52,10 +52,10 @@ private static void sendTagMessage(CodeObject data, TextChannel channel) { if (customHead == null) { File actionIcon = Util.fetchMinecraftTextureFile(data.getItem().getMaterial().toUpperCase()); builder.setThumbnail("attachment://" + actionIcon.getName()); - channel.sendMessage(builder.build()).addFile(actionIcon).queue(); + channel.sendMessageEmbeds(builder.build()).addFile(actionIcon).queue(); } else { builder.setThumbnail(customHead); - channel.sendMessage(builder.build()).queue(); + channel.sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/StoreCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/StoreCommand.java index 4b058f80..853c7e7f 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/StoreCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/StoreCommand.java @@ -80,7 +80,7 @@ public void run(CommandEvent event) { } builder.addField(":partying_face: Recent Purchases", String.join("\n", fieldval), false); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); }catch(Exception e) { event.reply(new PresetBuilder().withPreset(new InformativeReply(InformativeReplyType.ERROR, "Failed to retrieve store items."))); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/EvalCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/EvalCommand.java index 8d23dae3..220a3966 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/EvalCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/EvalCommand.java @@ -64,7 +64,7 @@ public void run(CommandEvent event) { builder.setTitle("No."); builder.setColor(Color.red); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); return; } @@ -83,7 +83,7 @@ public void run(CommandEvent event) { builder.setTitle("Eval Result"); builder.addField("Object Returned:", String.format("```js\n%s```", EmbedUtil.fieldSafe(object)), false); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } catch (Throwable e) { StringWriter sw = new StringWriter(); @@ -91,7 +91,7 @@ public void run(CommandEvent event) { String sStackTrace = sw.toString(); builder.setTitle("Eval failed!"); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); event.getChannel().sendMessage(String.format("```%s```", sStackTrace.length() >= 1500 ? sStackTrace.substring(0, 1500) : sStackTrace)).queue(); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/FetchDataCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/FetchDataCommand.java index b1497b7b..0d109001 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/FetchDataCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/FetchDataCommand.java @@ -11,14 +11,14 @@ import com.diamondfire.helpbot.sys.externalfile.ExternalFiles; import com.diamondfire.helpbot.util.PlainComponentSerializer; import com.github.steveice10.mc.auth.exception.request.RequestException; +import com.github.steveice10.mc.auth.service.AuthenticationService; import com.github.steveice10.mc.protocol.MinecraftProtocol; import com.github.steveice10.mc.protocol.data.game.MessageType; import com.github.steveice10.mc.protocol.packet.ingame.client.ClientChatPacket; import com.github.steveice10.mc.protocol.packet.ingame.server.*; -import com.github.steveice10.packetlib.*; import com.github.steveice10.packetlib.event.session.*; import com.github.steveice10.packetlib.packet.Packet; -import com.github.steveice10.packetlib.tcp.TcpSessionFactory; +import com.github.steveice10.packetlib.tcp.TcpClientSession; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.*; @@ -67,7 +67,7 @@ public void setup(TextChannel channel) { builder.setTitle("Fetching Code Database..."); builder.setDescription("Please wait a moment!"); - Message sentMessage = channel.sendMessage(builder.build()).complete(); + Message sentMessage = channel.sendMessageEmbeds(builder.build()).complete(); try { start(sentMessage); @@ -108,15 +108,19 @@ public void setup(TextChannel channel) { } private void start(Message message) throws RequestException { - MinecraftProtocol protocol = new MinecraftProtocol(USERNAME, PASSWORD); - Client client = new Client("beta.mcdiamondfire.com", 25565, protocol, new TcpSessionFactory()); - Session session = client.getSession(); + AuthenticationService authService = new AuthenticationService(); + authService.setUsername(USERNAME); + authService.setPassword(PASSWORD); + authService.login(); + + MinecraftProtocol protocol = new MinecraftProtocol(authService.getSelectedProfile(), authService.getAccessToken()); + TcpClientSession client = new TcpClientSession("beta.mcdiamondfire.com", 25565, protocol); status(message, "Connecting to DiamondFire..."); ready = false; - client.getSession().connect(); - client.getSession().addListener(new SessionAdapter() { + client.connect(); + client.addListener(new SessionAdapter() { @Override public void packetReceived(PacketReceivedEvent event) { Packet packet = event.getPacket(); @@ -146,7 +150,7 @@ public void packetReceived(PacketReceivedEvent event) { status(message, "Receiving data..."); ready = true; } else if (text.startsWith("}")) { - session.disconnect("HelpBot data collection has concluded. "); + client.disconnect("HelpBot data collection has concluded. "); } if (ready) { @@ -157,7 +161,7 @@ public void packetReceived(PacketReceivedEvent event) { } }); - while (session.isConnected()) { + while (client.isConnected()) { try { Thread.sleep(1); } catch (Exception ignored) { @@ -174,7 +178,7 @@ private void error(Message message, Exception e) { EmbedBuilder builder = new EmbedBuilder(); builder.setTitle("Error occurred!"); builder.setDescription(e.getMessage()); - message.editMessage(builder.build()).queue(); + message.editMessageEmbeds(builder.build()).queue(); e.printStackTrace(); } @@ -182,7 +186,7 @@ private void status(Message message, String status) { EmbedBuilder builder = new EmbedBuilder(); builder.setTitle("Status"); builder.setDescription(status); - message.editMessage(builder.build()).queue(); + message.editMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/QueryCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/QueryCommand.java index 848ee77f..0e85f3c6 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/QueryCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/QueryCommand.java @@ -82,7 +82,7 @@ public void run(CommandEvent event) { e.printStackTrace(new PrintWriter(sw)); String sStackTrace = sw.toString(); builder.setTitle("Query failed! " + e.getClass().getName()); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); event.getChannel().sendMessage(String.format("```%s```", sStackTrace.length() >= 1500 ? sStackTrace.substring(0, 1500) : sStackTrace)).queue(); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/RestartCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/RestartCommand.java index 4a54dcf4..4ea13503 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/RestartCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dev/RestartCommand.java @@ -43,7 +43,7 @@ public void run(CommandEvent event) { builder.setTitle("Restarting!"); builder.setDescription("This may take a moment"); - event.getChannel().sendMessage(builder.build()).queue((msg) -> { + event.getChannel().sendMessageEmbeds(builder.build()).queue((msg) -> { RestartHandler.logRestart(msg); System.exit(0); }); diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dumps/ImageDumpCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dumps/ImageDumpCommand.java index 4c333d50..9500c7b2 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dumps/ImageDumpCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/dumps/ImageDumpCommand.java @@ -50,7 +50,7 @@ public void run(CommandEvent event) { } catch (IOException e) { PresetBuilder builderError = new PresetBuilder(); builder.withPreset(new InformativeReply(InformativeReplyType.ERROR, "Failed to send zip file.")); - msg.editMessage(builderError.getEmbed().build()).queue(); + msg.editMessageEmbeds(builderError.getEmbed().build()).queue(); } }); diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/EightBallCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/EightBallCommand.java index 52ed829e..f4645e2f 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/EightBallCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/EightBallCommand.java @@ -72,7 +72,7 @@ public void run(CommandEvent event) { builder.setTitle(":8ball: | " + event.getArgument("question")); builder.setDescription(responses[rdm.nextInt(responses.length)]); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/GarfieldCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/GarfieldCommand.java index 00a50e08..05eb8b2a 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/GarfieldCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/GarfieldCommand.java @@ -57,7 +57,7 @@ public void run(CommandEvent event) { builder.setTitle(":rotating_light: API BROKE :rotating_light:"); builder.setDescription("DM: <@223518178100248576>\nPING: <@223518178100248576>"); } - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/IdeaCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/IdeaCommand.java index ab0280d8..2b93c966 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/IdeaCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/IdeaCommand.java @@ -237,7 +237,7 @@ public void run(CommandEvent event) { builder.setTitle("Idea"); builder.setDescription(types[rdm.nextInt(types.length)] + " " + objectives[rdm.nextInt(objectives.length)] + " " + rewards[rdm.nextInt(rewards.length)]); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/NbsCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/NbsCommand.java index b18ca2f9..5348c249 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/NbsCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/NbsCommand.java @@ -72,7 +72,7 @@ public void run(CommandEvent event) { .addField("Link: __Expires in 2 minutes__","[Template Link](https://derpystuff.gitlab.io/code/l?link=" + json.get("link").getAsString() + ")",false) .addField("Info:","Click the link shown above and click the button in the bottom left corner to copy the give command for the template. You will need [this function](https://derpystuff.gitlab.io/code/l?link=7cf5d91c35bbde31c28567d8d8945c40) to play songs.",false); - channel.sendMessage(embed.build()).queue(); + channel.sendMessageEmbeds(embed.build()).queue(); } catch(OutdatedNBSException | IOException e) { e.printStackTrace(); event.reply(error); diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/SamQuotesCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/SamQuotesCommand.java index 0ceddad8..478a1a1b 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/SamQuotesCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/fun/SamQuotesCommand.java @@ -66,7 +66,7 @@ public void run(CommandEvent event) { builder.setImage("attachment://quote.png"); builder.setColor(new Color(87, 177, 71)); - event.getChannel().sendMessage(builder.build()).addFile(file, "quote.png").queue(); + event.getChannel().sendMessageEmbeds(builder.build()).addFile(file, "quote.png").queue(); } else if (event.getArgument("action").equals("submit")) { @@ -440,7 +440,7 @@ public void run(CommandEvent event) { builder.setImage("attachment://quote.png"); builder.setColor(new Color(87, 177, 71)); - event.getChannel().sendMessage(builder.build()).addFile(samQuote, "quote.png").queue(); + event.getChannel().sendMessageEmbeds(builder.build()).addFile(samQuote, "quote.png").queue(); } else if (event.getArgument("action").equals("reload")) { @@ -459,7 +459,7 @@ public void run(CommandEvent event) { builder.setDescription("" + strings.length); builder.setColor(new Color(87, 177, 71)); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } else { @@ -470,7 +470,7 @@ public void run(CommandEvent event) { builder.setImage("attachment://quote.png"); builder.setColor(new Color(87, 177, 71)); - event.getChannel().sendMessage(builder.build()).addFile(file, "quote.png").queue(); + event.getChannel().sendMessageEmbeds(builder.build()).addFile(file, "quote.png").queue(); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/HelpCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/HelpCommand.java index d027f00b..33c261e0 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/HelpCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/HelpCommand.java @@ -108,7 +108,7 @@ public void run(CommandEvent event) { builder.addField("Category", context.getCommandCategory().toString(), true); builder.addField("Role Required", String.format("<@&%s>", command.getPermission().getRole()), true); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/AbstractFileListCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/AbstractFileListCommand.java index c327a46d..9b313df0 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/AbstractFileListCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/AbstractFileListCommand.java @@ -39,7 +39,7 @@ protected void generate(CommandEvent event, List data) { } catch (IOException e) { EmbedBuilder builder = new EmbedBuilder(); builder.setTitle("Could not generate file!"); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); return; } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/PollCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/PollCommand.java index 8ed8d200..f8965927 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/PollCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/util/PollCommand.java @@ -99,7 +99,7 @@ public void run(CommandEvent event) { builder.setDescription(String.join(" ", fullPollOptions)); //adds poll options builder.setColor(new Color(33, 40, 97)); - event.getChannel().sendMessage(builder.build()).queue((message) -> { //send embed message + event.getChannel().sendMessageEmbeds(builder.build()).queue((message) -> { //send embed message //add reactions Deque nums = Util.getUnicodeNumbers(); diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/individualized/HistoryCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/individualized/HistoryCommand.java index 6822ff71..6a1e5cac 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/individualized/HistoryCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/individualized/HistoryCommand.java @@ -183,6 +183,3 @@ protected void execute(CommandEvent event, Player player) { } } - - - diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/metrics/JoinsCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/metrics/JoinsCommand.java index b4bf73ba..3dce51b8 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/metrics/JoinsCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/metrics/JoinsCommand.java @@ -43,6 +43,6 @@ public void run(CommandEvent event) { builder.setDescription(String.format("A total of %s players have joined DiamondFire before!", count)); }); - event.getChannel().sendMessage(builder.build()).queue(); + event.getChannel().sendMessageEmbeds(builder.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/FindSupporteeNamesCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/FindSupporteeNamesCommand.java index a7fffd8d..e40fdea9 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/FindSupporteeNamesCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/FindSupporteeNamesCommand.java @@ -131,7 +131,7 @@ protected void execute(CommandEvent event, Player player) { builder.getEmbed().addField("", "Player hasn't been helped by anybody!", false); } - msg.editMessage(builder.getEmbed().build()).override(true).queue(); + msg.editMessageEmbeds(builder.getEmbed().build()).override(true).queue(); }); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/TotalStatsCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/TotalStatsCommand.java index 9cbe1785..a7222f0e 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/TotalStatsCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/support/TotalStatsCommand.java @@ -137,7 +137,7 @@ public void run(CommandEvent event) { }); - msg.editMessage(embed.build()).queue(); + msg.editMessageEmbeds(embed.build()).queue(); }); } diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/reply/ReplyHandler.java b/src/main/java/com/diamondfire/helpbot/bot/command/reply/ReplyHandler.java index 22e673a2..b47f9fff 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/reply/ReplyHandler.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/reply/ReplyHandler.java @@ -45,7 +45,7 @@ public MessageAction replyA(PresetBuilder preset, MessageChannel channel) { } public MessageAction embedReply(EmbedBuilder embed, MessageChannel channel) { - return channel.sendMessage(embed.build()); + return channel.sendMessageEmbeds(embed.build()); } public MessageAction textReply(String msg, MessageChannel channel) { diff --git a/src/main/java/com/diamondfire/helpbot/sys/multiselector/MultiSelector.java b/src/main/java/com/diamondfire/helpbot/sys/multiselector/MultiSelector.java index 4b6db69a..890de253 100644 --- a/src/main/java/com/diamondfire/helpbot/sys/multiselector/MultiSelector.java +++ b/src/main/java/com/diamondfire/helpbot/sys/multiselector/MultiSelector.java @@ -42,10 +42,10 @@ public void send(JDA jda) { buttons.add(button); } - jda.getTextChannelById(channel).sendMessage(pages[0].getPage().build()).setActionRows(Util.of(buttons)).queue((message) -> { + jda.getTextChannelById(channel).sendMessageEmbeds(pages[0].getPage().build()).setActionRows(Util.of(buttons)).queue((message) -> { ButtonHandler.addListener(user, message, event -> { event.deferEdit().queue(); - message.editMessage(pageMap.get(event.getComponentId()).getPage().build()).setActionRows(message.getActionRows()).queue(); + message.editMessageEmbeds(pageMap.get(event.getComponentId()).getPage().build()).setActionRows(message.getActionRows()).queue(); }, true); }); } diff --git a/src/main/java/com/diamondfire/helpbot/sys/tag/Tag.java b/src/main/java/com/diamondfire/helpbot/sys/tag/Tag.java index cce56291..1bd17f95 100644 --- a/src/main/java/com/diamondfire/helpbot/sys/tag/Tag.java +++ b/src/main/java/com/diamondfire/helpbot/sys/tag/Tag.java @@ -81,6 +81,6 @@ public void sendResponse(TextChannel channel) { .setFooter("Written by "+user.getAsTag(), user.getAvatarUrl()); if (!getImage().equals("")) embed.setImage(getImage()); - channel.sendMessage(embed.build()).queue(); + channel.sendMessageEmbeds(embed.build()).queue(); } } diff --git a/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/RefreshCreditsTask.java b/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/RefreshCreditsTask.java index 3bd36086..0e02a101 100644 --- a/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/RefreshCreditsTask.java +++ b/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/RefreshCreditsTask.java @@ -12,7 +12,7 @@ public class RefreshCreditsTask implements MidnightTask { public void run() { PresetBuilder preset = new PresetBuilder(); preset.withPreset(new InformativeReply(InformativeReplyType.INFO, "Credit log db has been updated")); - RESPONSE_CHANNEL.sendMessage(preset.getEmbed().build()).queue(); + RESPONSE_CHANNEL.sendMessageEmbeds(preset.getEmbed().build()).queue(); new DatabaseQuery() .query(new BasicQuery("INSERT INTO owen.creator_rankings_log(uuid, points, `rank`, date) " + diff --git a/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/SupportUnexcuseTask.java b/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/SupportUnexcuseTask.java index e2968334..04515a1b 100644 --- a/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/SupportUnexcuseTask.java +++ b/src/main/java/com/diamondfire/helpbot/sys/tasks/impl/SupportUnexcuseTask.java @@ -56,7 +56,7 @@ public void run() { ); embed.setTitle(String.format("Excuse has expired! (%s day duration)", Duration.between(initDate.toInstant(), Instant.now()).toDays())); - channel.sendMessage(embed.build()).queue(); + channel.sendMessageEmbeds(embed.build()).queue(); new DatabaseQuery() .query(new BasicQuery("UPDATE owen.excused_staff SET handled = true WHERE uuid = ?", (statement) -> statement.setString(1, uuid))) diff --git a/src/main/java/com/diamondfire/helpbot/util/Util.java b/src/main/java/com/diamondfire/helpbot/util/Util.java index 5e978161..a9b97962 100644 --- a/src/main/java/com/diamondfire/helpbot/util/Util.java +++ b/src/main/java/com/diamondfire/helpbot/util/Util.java @@ -114,7 +114,7 @@ public static void log(PresetBuilder builder) { } public static void log(EmbedBuilder builder) { - HelpBotInstance.getJda().getTextChannelById(HelpBotInstance.LOG_CHANNEL).sendMessage(builder.build()).queue(); + HelpBotInstance.getJda().getTextChannelById(HelpBotInstance.LOG_CHANNEL).sendMessageEmbeds(builder.build()).queue(); } public static void updateGuild(HashMap accounts, Guild guild) {