Added command to list enabled modules (op).

This commit is contained in:
Erik C. Thauvin 2020-03-23 23:22:57 -07:00
parent 2f50c6c1c3
commit a381b06a0a
4 changed files with 31 additions and 8 deletions

View file

@ -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.

View file

@ -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.
*

View file

@ -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)) {

View file

@ -1,9 +1,9 @@
#Generated by the Semver Plugin for Gradle
#Mon Mar 23 22:32:51 PDT 2020
version.buildmeta=712
#Mon Mar 23 23:04:40 PDT 2020
version.buildmeta=714
version.major=0
version.minor=7
version.patch=3
version.prerelease=beta
version.project=mobibot
version.semver=0.7.3-beta+712
version.semver=0.7.3-beta+714