diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index ffded5d..bc94f0c 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -655,10 +655,10 @@ public class Mobibot extends PircBot { Collections.sort(opsCommandsNames); } - sendCommandsList(sender, commandsNames, 8, isPrivate, true); + sendList(sender, commandsNames, 8, isPrivate, true); if (isOp) { send(sender, "The op commands are:", isPrivate); - sendCommandsList(sender, opsCommandsNames, 8, isPrivate, true); + sendList(sender, opsCommandsNames, 8, isPrivate, true); } } @@ -994,11 +994,11 @@ public class Mobibot extends PircBot { * @param isPrivate The private flag. * @param isBold The bold flag */ - public final void sendCommandsList(final String nick, - final List list, - final int size, - final boolean isPrivate, - final boolean isBold) { + public final void sendList(final String nick, + final List list, + final int size, + final boolean isPrivate, + final boolean isBold) { for (int i = 0; i < list.size(); i += size) { send(nick, Utils.helpIndent( String.join(" ", list.subList(i, Math.min(list.size(), i + size))), isBold), isPrivate); diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt index ffc42a0..79c6a08 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt @@ -144,7 +144,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() { if (ignored.size > 0) { bot.send(sender, "The following nicks are ignored:", isPrivate) - bot.sendCommandsList(sender, ignored.toList(), 8, isPrivate, true) + bot.sendList(sender, ignored.toList(), 8, isPrivate, true) } else { bot.send(sender, "No one is currently ${Utils.bold("ignored")}.", isPrivate) } diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Modules.kt b/src/main/java/net/thauvin/erik/mobibot/commands/Modules.kt index 0d02f05..e997677 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Modules.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Modules.kt @@ -59,7 +59,7 @@ class Modules : AbstractCommand() { bot.send(sender, "There are no enabled modules.", isPrivate) } else { bot.send(sender, "The enabled modules are: ", isPrivate) - bot.sendCommandsList(sender, modulesNames, 7, isPrivate, false) + bot.sendList(sender, modulesNames, 7, isPrivate, false) } } else { bot.helpDefault(sender, isOp, isPrivate) diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Users.kt b/src/main/java/net/thauvin/erik/mobibot/commands/Users.kt index 9ee5add..73524f3 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Users.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Users.kt @@ -60,12 +60,12 @@ class Users : AbstractCommand() { val nicks = ArrayList() users.forEach { user -> if (bot.isOp(user.nick)) { - nicks.add('@'.toString() + user.nick) + nicks.add("@${user.nick}") } else { nicks.add(user.nick) } } - bot.send(sender, nicks.sorted().joinToString(" "), isPrivate) + bot.sendList(sender, nicks.sorted(), 8, isPrivate, false) } } diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java index 03a7737..c6c3fce 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java @@ -218,7 +218,7 @@ public final class CurrencyConverter extends ThreadedModule { } } else if (query.contains(CURRENCY_RATES_KEYWORD)) { bot.send(sender, "The currency rates for " + Utils.bold(pubDate) + " are:", isPrivate); - bot.sendCommandsList(sender, currencyRates(), 3, isPrivate, false); + bot.sendList(sender, currencyRates(), 3, isPrivate, false); } else { helpResponse(bot, sender, isPrivate); } @@ -250,7 +250,7 @@ public final class CurrencyConverter extends ThreadedModule { bot.getNick(), isPrivate)), isPrivate); bot.send(sender, "The supported currencies are: ", isPrivate); - bot.sendCommandsList(sender, new ArrayList<>(EXCHANGE_RATES.keySet()), 11, isPrivate, false); + bot.sendList(sender, new ArrayList<>(EXCHANGE_RATES.keySet()), 11, isPrivate, false); } } } diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java b/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java index 91fb27c..2eaa86c 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/WorldTime.java @@ -225,7 +225,7 @@ public final class WorldTime extends AbstractModule { final boolean isPrivate) { if (args.length() == 0) { bot.send(sender, "The supported countries/zones are: ", isPrivate); - bot.sendCommandsList(sender, new ArrayList<>(COUNTRIES_MAP.keySet()), 17, false, false); + bot.sendList(sender, new ArrayList<>(COUNTRIES_MAP.keySet()), 17, false, false); } else { final Message msg = worldTime(args); if (isPrivate) {