diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.kt b/src/main/java/net/thauvin/erik/mobibot/Mobibot.kt index a743c88..ea26829 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.kt +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.kt @@ -399,7 +399,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert * Sends a notice to the channel. */ fun send(notice: String?) { - if (notice != null) send(channel, notice, false) + notice?.let { send(channel, it, false) } } /** @@ -419,6 +419,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert /** * Send a formatted commands/modules, etc. list. */ + @JvmOverloads fun sendList( nick: String, list: List, @@ -600,6 +601,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert init { System.getProperties().setProperty("sun.net.client.defaultConnectTimeout", Constants.CONNECT_TIMEOUT.toString()) System.getProperties().setProperty("sun.net.client.defaultReadTimeout", Constants.CONNECT_TIMEOUT.toString()) + name = nickname ircServer = p.getProperty("server", Constants.DEFAULT_SERVER) ircPort = getIntProperty(p.getProperty("port"), Constants.DEFAULT_PORT) diff --git a/src/main/java/net/thauvin/erik/mobibot/Utils.kt b/src/main/java/net/thauvin/erik/mobibot/Utils.kt index a165328..a8e7b63 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Utils.kt +++ b/src/main/java/net/thauvin/erik/mobibot/Utils.kt @@ -156,7 +156,7 @@ object Utils { @JvmStatic @JvmOverloads fun helpFormat(help: String, isBold: Boolean = true, isIndent: Boolean = true): String { - return (if (isIndent) " " else "").plus(if (isBold) bold(help) else help) + return (if (isIndent) " " else "").plus(if (isBold) bold(help) else help) } /** diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Info.java b/src/main/java/net/thauvin/erik/mobibot/commands/Info.java index 09043aa..224daf3 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Info.java +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Info.java @@ -85,7 +85,7 @@ public class Info extends AbstractCommand { @NotNull final String args, final boolean isOp, final boolean isPrivate) { - getBot().sendList(sender, allVersions, 1, isPrivate, false, false); + getBot().sendList(sender, allVersions, 1, isPrivate); final StringBuilder info = new StringBuilder("Uptime: "); diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java b/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java index 662d073..7413156 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java @@ -41,10 +41,10 @@ import java.util.List; public class Versions extends AbstractCommand { private final List allVersions = - List.of("Version: " + ReleaseInfo.VERSION + " (" + Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')', + List.of("Version: " + ReleaseInfo.VERSION + " (" + Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')', "Platform: " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + " (" + System.getProperty("os.arch") + ')', - "Runtime: " + System.getProperty("java.runtime.name") + "Runtime: " + System.getProperty("java.runtime.name") + ' ' + System.getProperty("java.runtime.version")); public Versions(@NotNull final Mobibot bot) { @@ -86,7 +86,7 @@ public class Versions extends AbstractCommand { final boolean isOp, final boolean isPrivate) { if (isOp) { - getBot().sendList(sender, allVersions, 1, isPrivate, false, false); + getBot().sendList(sender, allVersions, 1, isPrivate); } else { getBot().helpDefault(sender, false, isPrivate); }