-
Notifications
You must be signed in to change notification settings - Fork 0
Interactions
itsmefox edited this page Nov 25, 2022
·
12 revisions
All slash commands are handled with the abstract class DiscordCommand
. To create a new command, you have to extend this class and set a unique name as well as a description.
@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()
}
}
}
Viascom GmbH