add logback logging and compatability. Also test Ping command.

This commit is contained in:
2024-12-23 01:25:01 +01:00
parent 3473657fbb
commit 2b3423c1c9
6 changed files with 121 additions and 38 deletions

View File

@@ -0,0 +1,27 @@
package net.tomatentum.tomatenmusic3.command;
import java.time.Duration;
import java.time.Instant;
import org.javacord.api.entity.message.MessageFlag;
import org.javacord.api.interaction.SlashCommandInteraction;
import net.tomatentum.marinara.interaction.InteractionHandler;
import net.tomatentum.marinara.interaction.commands.annotation.SlashCommand;
public class PingCommand implements InteractionHandler {
@SlashCommand(
name = "ping",
description = "Tests bot's connection."
)
public void execPing(SlashCommandInteraction interaction) {
Duration ping = Duration.between(interaction.getCreationTimestamp(), Instant.now());
interaction.createImmediateResponder()
.append("Pong! " + ping.toMillis() + "ms")
.setFlags(MessageFlag.EPHEMERAL)
.respond().join();
}
}