Add basic README and ASCII logo
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Bea 2022-08-25 22:54:08 +02:00
parent 94c126e32b
commit 1f12dcbb1c
3 changed files with 43 additions and 1 deletions

15
README.MD Normal file
View File

@ -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.

View File

@ -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);
}
}

View File

@ -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;
}
}