Last active
May 20, 2022 08:52
-
-
Save itsmefox/258646aabb3f3e05f2604c68ca3a6338 to your computer and use it in GitHub Desktop.
Creating a Discord Bot with Kotlin - BasicBotApplication - 2
This file contains hidden or 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
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