Changed sendCommandsList to sendList.
This commit is contained in:
parent
b73ffc061d
commit
fc35b6bfc8
6 changed files with 14 additions and 14 deletions
|
@ -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,11 +994,11 @@ 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,
|
||||||
final boolean isBold) {
|
final boolean isBold) {
|
||||||
for (int i = 0; i < list.size(); i += size) {
|
for (int i = 0; i < list.size(); i += size) {
|
||||||
send(nick, Utils.helpIndent(
|
send(nick, Utils.helpIndent(
|
||||||
String.join(" ", list.subList(i, Math.min(list.size(), i + size))), isBold), isPrivate);
|
String.join(" ", list.subList(i, Math.min(list.size(), i + size))), isBold), isPrivate);
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue