Skip to content

Instantly share code, notes, and snippets.

@itsmefox
Last active May 20, 2022 08:52
Show Gist options
  • Save itsmefox/258646aabb3f3e05f2604c68ca3a6338 to your computer and use it in GitHub Desktop.
Save itsmefox/258646aabb3f3e05f2604c68ca3a6338 to your computer and use it in GitHub Desktop.
Creating a Discord Bot with Kotlin - BasicBotApplication - 2
class BasicBotApplication {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val token = ""
//Create a new JDA instance
val jda = JDABuilder.createDefault(token)
.addEventListeners(PingCommand())
.build()
//Register our first command /ping (don't use this method to often ;))
jda.upsertCommand("ping", "Send a ping command").queue()
//Set the activity to "I'm Ready"
jda.presence.activity = Activity.playing("I'm Ready")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment