Created
June 22, 2022 12:32
-
-
Save itsmefox/92831e41c4cc9802e22d3a7fccfce5bb to your computer and use it in GitHub Desktop.
Creating a Discord Bot with Kotlin - Application - 2
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
public class Application { | |
public static void main(String[] args) throws LoginException { | |
String token = ""; | |
//Create a new JDA instance | |
JDA jda = JDABuilder.createDefault(token) | |
.addEventListeners(new PingCommand()) //Register our /ping Command | |
.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.getPresence().setActivity(Activity.playing("I'm Ready")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment