diff --git a/src/main/java/linux/general/hackyquizbot/Main.java b/src/main/java/linux/general/hackyquizbot/Main.java new file mode 100644 index 0000000..0b2eeab --- /dev/null +++ b/src/main/java/linux/general/hackyquizbot/Main.java @@ -0,0 +1,25 @@ +package linux.general.hackyquizbot; + +import org.javacord.api.DiscordApi; +import org.javacord.api.DiscordApiBuilder; + +public class Main { + + public static void main(String[] args) { + // Insert your bot's token here + String token = args[0]; + + DiscordApi api = new DiscordApiBuilder().setToken(token).login().join(); + + // Add a listener which answers with "Pong!" if someone writes "!ping" + api.addMessageCreateListener(event -> { + if (event.getMessageContent().equalsIgnoreCase("!ping")) { + event.getChannel().sendMessage("Pong!"); + } + }); + + // Print the invite url of your bot + System.out.println("You can invite the bot by using the following url: " + api.createBotInvite()); + } + +}