Skip to content

Instantly share code, notes, and snippets.

@itsmefox
Created June 22, 2022 12:32
Show Gist options
  • Save itsmefox/92831e41c4cc9802e22d3a7fccfce5bb to your computer and use it in GitHub Desktop.
Save itsmefox/92831e41c4cc9802e22d3a7fccfce5bb to your computer and use it in GitHub Desktop.
Creating a Discord Bot with Kotlin - Application - 2
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