From 489cd9620804386d1d6cfc8fd254c42b57af15d5 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 25 Sep 2021 05:22:43 +0100 Subject: [PATCH] Reformat code --- src/main/java/me/goudham/bot/command/info/Ping.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/goudham/bot/command/info/Ping.java b/src/main/java/me/goudham/bot/command/info/Ping.java index 131647b1..aead8c31 100644 --- a/src/main/java/me/goudham/bot/command/info/Ping.java +++ b/src/main/java/me/goudham/bot/command/info/Ping.java @@ -5,6 +5,7 @@ import jakarta.inject.Inject; import me.goudham.command.annotation.SlashCommand; import me.goudham.service.EmbedService; import net.dv8tion.jda.api.JDA; +import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.events.interaction.SlashCommandEvent; @SlashCommand(name = "ping", description = "Display the latency of the bot") @@ -19,6 +20,11 @@ public class Ping { @Executable public void handle(SlashCommandEvent slashCommandEvent) { JDA jda = slashCommandEvent.getJDA(); - jda.getRestPing().queue(ping -> slashCommandEvent.replyEmbeds(embedService.getBaseEmbed().setDescription("**Rest ping: " + ping + "ms**\n**WS ping: " + jda.getGatewayPing() + "ms**").build()).queue()); + jda.getRestPing().queue(ping -> { + MessageEmbed messageEmbed = embedService.getBaseEmbed() + .setDescription("**Rest ping: " + ping + "ms**\n**WS ping: " + jda.getGatewayPing() + "ms**") + .build(); + slashCommandEvent.replyEmbeds(messageEmbed).queue(); + }); } } \ No newline at end of file