Changed sendCommandsList to sendList.

This commit is contained in:
Erik C. Thauvin 2020-04-16 15:40:30 -07:00
parent b73ffc061d
commit fc35b6bfc8
6 changed files with 14 additions and 14 deletions

View file

@ -655,10 +655,10 @@ public class Mobibot extends PircBot {
Collections.sort(opsCommandsNames); Collections.sort(opsCommandsNames);
} }
sendCommandsList(sender, commandsNames, 8, isPrivate, true); sendList(sender, commandsNames, 8, isPrivate, true);
if (isOp) { if (isOp) {
send(sender, "The op commands are:", isPrivate); send(sender, "The op commands are:", isPrivate);
sendCommandsList(sender, opsCommandsNames, 8, isPrivate, true); sendList(sender, opsCommandsNames, 8, isPrivate, true);
} }
} }
@ -994,7 +994,7 @@ public class Mobibot extends PircBot {
* @param isPrivate The private flag. * @param isPrivate The private flag.
* @param isBold The bold flag * @param isBold The bold flag
*/ */
public final void sendCommandsList(final String nick, public final void sendList(final String nick,
final List<String> list, final List<String> list,
final int size, final int size,
final boolean isPrivate, final boolean isPrivate,

View file

@ -144,7 +144,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() {
if (ignored.size > 0) { if (ignored.size > 0) {
bot.send(sender, "The following nicks are ignored:", isPrivate) 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 { } else {
bot.send(sender, "No one is currently ${Utils.bold("ignored")}.", isPrivate) bot.send(sender, "No one is currently ${Utils.bold("ignored")}.", isPrivate)
} }

View file

@ -59,7 +59,7 @@ class Modules : AbstractCommand() {
bot.send(sender, "There are no enabled modules.", isPrivate) bot.send(sender, "There are no enabled modules.", isPrivate)
} else { } else {
bot.send(sender, "The enabled modules are: ", isPrivate) bot.send(sender, "The enabled modules are: ", isPrivate)
bot.sendCommandsList(sender, modulesNames, 7, isPrivate, false) bot.sendList(sender, modulesNames, 7, isPrivate, false)
} }
} else { } else {
bot.helpDefault(sender, isOp, isPrivate) bot.helpDefault(sender, isOp, isPrivate)

View file

@ -60,12 +60,12 @@ class Users : AbstractCommand() {
val nicks = ArrayList<String>() val nicks = ArrayList<String>()
users.forEach { user -> users.forEach { user ->
if (bot.isOp(user.nick)) { if (bot.isOp(user.nick)) {
nicks.add('@'.toString() + user.nick) nicks.add("@${user.nick}")
} else { } else {
nicks.add(user.nick) nicks.add(user.nick)
} }
} }
bot.send(sender, nicks.sorted().joinToString(" "), isPrivate) bot.sendList(sender, nicks.sorted(), 8, isPrivate, false)
} }
} }

View file

@ -218,7 +218,7 @@ public final class CurrencyConverter extends ThreadedModule {
} }
} else if (query.contains(CURRENCY_RATES_KEYWORD)) { } else if (query.contains(CURRENCY_RATES_KEYWORD)) {
bot.send(sender, "The currency rates for " + Utils.bold(pubDate) + " are:", isPrivate); 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 { } else {
helpResponse(bot, sender, isPrivate); helpResponse(bot, sender, isPrivate);
} }
@ -250,7 +250,7 @@ public final class CurrencyConverter extends ThreadedModule {
bot.getNick(), bot.getNick(),
isPrivate)), isPrivate); isPrivate)), isPrivate);
bot.send(sender, "The supported currencies are: ", 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);
} }
} }
} }

View file

@ -225,7 +225,7 @@ public final class WorldTime extends AbstractModule {
final boolean isPrivate) { final boolean isPrivate) {
if (args.length() == 0) { if (args.length() == 0) {
bot.send(sender, "The supported countries/zones are: ", isPrivate); 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 { } else {
final Message msg = worldTime(args); final Message msg = worldTime(args);
if (isPrivate) { if (isPrivate) {