Skip to content

Instantly share code, notes, and snippets.

@itsmefox
Created November 24, 2022 16:05
Show Gist options
  • Save itsmefox/cb14dd3be2141b9ce5c533d0b9ad161c to your computer and use it in GitHub Desktop.
Save itsmefox/cb14dd3be2141b9ce5c533d0b9ad161c to your computer and use it in GitHub Desktop.
Create your Discord Bot with aluna-spring-boot-starter - PingCommand
@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