diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..45c1c62 --- /dev/null +++ b/README.MD @@ -0,0 +1,15 @@ +# HidekoBot + +Hideko is a general-purpose Discord bot. + +## Startup +Download a prebuilt JAR file or build it from source, then run it with: +```bash +java -jar HidekoBot.jar botToken +``` +Where `HidekoBot.jar` is the executable archive and `botToken` is your bot token passed as an argument. + +## Initial setup + +After starting the bot up successfully, it will print an invite-link in your console. Click on the link to add your bot +to any server with the correct permissions already set-up. \ No newline at end of file diff --git a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java index 046ddcc..91eca60 100644 --- a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java +++ b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java @@ -14,6 +14,8 @@ public class HidekoBot private static String standardInviteLink = "https://discord.com/oauth2/authorize?client_id=%userid%&scope=bot&permissions=8"; private static String botUserId; + private static final String version = "0.0.1"; + public static void main(String[] args) { @@ -45,11 +47,15 @@ public class HidekoBot botUserId = jda.getSelfUser().getId(); standardInviteLink = standardInviteLink.replace("%userid%", botUserId); + // print the bot logo. + logger.log("Ready!\n\n" + logger.getLogo() + "\nv" + version + " - bot is ready!\n", 2); + // log the invite-link to console so noob users can just click on it. logger.log("Bot User ID: " + botUserId, 5); logger.log("Invite Link: " + standardInviteLink, 5); + } } diff --git a/src/main/java/wtf/beatrice/hidekobot/utils/Logger.java b/src/main/java/wtf/beatrice/hidekobot/utils/Logger.java index 38a4b3c..2fca360 100644 --- a/src/main/java/wtf/beatrice/hidekobot/utils/Logger.java +++ b/src/main/java/wtf/beatrice/hidekobot/utils/Logger.java @@ -8,6 +8,15 @@ import java.util.concurrent.TimeUnit; public class Logger { + // cosmetic string to print on startup. + private String logo = + "██╗░░██╗██╗██████╗░███████╗██╗░░██╗░█████╗░\n" + + "██║░░██║██║██╔══██╗██╔════╝██║░██╔╝██╔══██╗\n" + + "███████║██║██║░░██║█████╗░░█████═╝░██║░░██║\n" + + "██╔══██║██║██║░░██║██╔══╝░░██╔═██╗░██║░░██║\n" + + "██║░░██║██║██████╔╝███████╗██║░╚██╗╚█████╔╝\n" + + "╚═╝░░╚═╝╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝░╚════╝░"; + // objects that we need to have for a properly formatted message private String className; private final String format = "[%date% %time%] [%class%] %message%"; @@ -27,7 +36,7 @@ public class Logger LocalDateTime now = LocalDateTime.now(); String currentDate = dateFormatter.format(now); String currentTime = timeFormatter.format(now); - System.out.println(format + logRaw(format .replace("%date%", currentDate) .replace("%time%", currentTime) .replace("%class%", className) @@ -50,4 +59,16 @@ public class Logger }, delay, TimeUnit.SECONDS); } + + // avoid formatting the text and print whatever is passed. + public void logRaw(String message) + { + System.out.println(message); + } + + public String getLogo() + { + return logo; + } + }