Added command to list enabled modules (op).
This commit is contained in:
parent
2f50c6c1c3
commit
a381b06a0a
4 changed files with 31 additions and 8 deletions
|
@ -14,13 +14,13 @@ import java.time.*;
|
|||
public final class ReleaseInfo {
|
||||
public static final String PROJECT = "mobibot";
|
||||
public static final LocalDateTime BUILDDATE =
|
||||
LocalDateTime.ofInstant(Instant.ofEpochMilli(1585027973338L), ZoneId.systemDefault());
|
||||
LocalDateTime.ofInstant(Instant.ofEpochMilli(1585029881513L), ZoneId.systemDefault());
|
||||
public static final int MAJOR = 0;
|
||||
public static final int MINOR = 7;
|
||||
public static final int PATCH = 3;
|
||||
public static final String PRERELEASE = "beta";
|
||||
public static final String BUILDMETA = "712";
|
||||
public static final String VERSION = "0.7.3-beta+712";
|
||||
public static final String BUILDMETA = "714";
|
||||
public static final String VERSION = "0.7.3-beta+714";
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
|
|
|
@ -100,6 +100,10 @@ public final class Commands {
|
|||
* The me command.
|
||||
*/
|
||||
static final String ME_CMD = "me";
|
||||
/**
|
||||
* The modules command.
|
||||
*/
|
||||
static final String MODULES_CMD = "modules";
|
||||
/**
|
||||
* The msg command.
|
||||
*/
|
||||
|
@ -133,6 +137,7 @@ public final class Commands {
|
|||
*/
|
||||
static final String VERSION_CMD = "version";
|
||||
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
|
|
|
@ -749,8 +749,17 @@ public class Mobibot extends PircBot {
|
|||
if (isOp(sender)) {
|
||||
send(sender, "The op commands are:");
|
||||
send(sender,
|
||||
helpIndent(Commands.CYCLE_CMD + " " + Commands.ME_CMD + " " + Commands.MSG_CMD + " "
|
||||
+ Commands.SAY_CMD + " " + Commands.VERSION_CMD));
|
||||
helpIndent(Commands.CYCLE_CMD
|
||||
+ " "
|
||||
+ Commands.ME_CMD
|
||||
+ " "
|
||||
+ Commands.MODULES_CMD
|
||||
+ " "
|
||||
+ Commands.MSG_CMD
|
||||
+ " "
|
||||
+ Commands.SAY_CMD
|
||||
+ " "
|
||||
+ Commands.VERSION_CMD));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1278,6 +1287,15 @@ public class Mobibot extends PircBot {
|
|||
} else {
|
||||
helpResponse(sender, Commands.ME_CMD);
|
||||
}
|
||||
} else if (Commands.MODULES_CMD.equals(cmd) && isOp(sender)) {
|
||||
if (MODULES.isEmpty()) {
|
||||
send(sender, "There are not enabled modules.", true);
|
||||
} else {
|
||||
send(sender, "The enabled modules are:");
|
||||
for (final AbstractModule mod : MODULES) {
|
||||
send(sender, helpIndent(mod.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
} else if ((cmds.length > 1) && isOp(sender) && Commands.NICK_CMD.equals(cmd)) {
|
||||
changeNick(args);
|
||||
} else if (Commands.SAY_CMD.equals(cmd) && isOp(sender)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue