Created
November 24, 2022 16:05
-
-
Save itsmefox/cb14dd3be2141b9ce5c533d0b9ad161c to your computer and use it in GitHub Desktop.
Create your Discord Bot with aluna-spring-boot-starter - PingCommand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Interaction | |
class PingCommand : DiscordCommand("ping", "Send a ping command") { | |
override fun execute(event: SlashCommandInteractionEvent) { | |
//Reply to the user | |
val startTime = System.currentTimeMillis() | |
event.reply("Ping ...").setEphemeral(true).queue { | |
it.editOriginal("Pong: ${System.currentTimeMillis() - startTime}ms").queue() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment