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