Convert some strings to text blocks

this is the coolest thing ive ever seen
This commit is contained in:
Anya 2022-05-21 19:05:53 -07:00
parent ae092d3440
commit 67dafe50bb
3 changed files with 22 additions and 21 deletions

View File

@ -63,8 +63,6 @@ public class KiafumiConfig {
*/ */
public boolean load() { public boolean load() {
try { try {
var n = System.lineSeparator() + "\033[0m"; // newline
// Discord loaders // Discord loaders
var discord = configuration.getConfigurationSection("discord"); var discord = configuration.getConfigurationSection("discord");
token = discord.getString("token"); // This used to log the token into stdout ??? token = discord.getString("token"); // This used to log the token into stdout ???
@ -74,14 +72,16 @@ public class KiafumiConfig {
clientId = discord.getString("clientId"); clientId = discord.getString("clientId");
defaultInvitePermissionLevel = discord.getInt("invitePermissionLevel"); defaultInvitePermissionLevel = discord.getInt("invitePermissionLevel");
// Log discord settings in a neat table. // Log discord settings in a neat table.
info("Printing loaded discord configuration." +n+ info("""
"DISCORD CONFIGURATION" +n+ Printing loaded discord configuration.
"--------------------------------" +n+ DISCORD CONFIGURATION
"Log Channel: \033[0;34m" + logChannel +n+ --------------------------------
"Owner ID: \033[0;34m" + ownerId +n+ Log Channel: %s
"Primary Guild: \033[0;34m" + mainGuild +n+ Owner ID: %s
"Invite URL: \033[0;34m" + assembleDefaultInvite() +n+ Primary Guild: %s
"--------------------------------"); Invite URL: %s
--------------------------------
""".formatted(logChannel, ownerId, mainGuild, assembleDefaultInvite()));
// Kiafumi loaders // Kiafumi loaders
var main = configuration.getConfigurationSection("main"); var main = configuration.getConfigurationSection("main");

View File

@ -37,12 +37,13 @@ public class MainListener extends ListenerAdapter {
*/ */
@Override @Override
public void onReady(@NotNull ReadyEvent event) { public void onReady(@NotNull ReadyEvent event) {
var n = System.lineSeparator(); info("""
info("Received READY signal from Discord, bot is now logged in." +n+ Received READY signal from Discord, bot is now logged in.
"--------------------------------" +n+ --------------------------------
"Active Guilds: " + event.getGuildAvailableCount() +n+ Active Guilds: [%s]
"Guilds Unavailable: " + event.getGuildUnavailableCount() +n+ Guilds Unavailable: [%s]
"--------------------------------"); --------------------------------
""".formatted(event.getGuildAvailableCount(), event.getGuildUnavailableCount()));
} }
/** /**

View File

@ -101,11 +101,11 @@ public class Server {
* @return - Options in a string that can be printed to discord. * @return - Options in a string that can be printed to discord.
*/ */
public String getOpts() { public String getOpts() {
return "welcomeEnabled - whether or not join/leave logs are enabled" + return """
"\nwelcomeChannel - the channel to send welcome messages to" + welcomeChannel - the channel to send welcome messages to
"\njoinRole - the role to apply to new members who join this guild" + modChannel - the channel to send moderation logs to
"\nserverProtected - Determines whether or not server protections are enabled." + joinRole - the role to apply to new members who join this guild
"\nmodRole - The moderator role for the /mod command (only works if protection enabled)"; """;
} }
/** /**