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 final class ReleaseInfo {
|
||||||
public static final String PROJECT = "mobibot";
|
public static final String PROJECT = "mobibot";
|
||||||
public static final LocalDateTime BUILDDATE =
|
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 MAJOR = 0;
|
||||||
public static final int MINOR = 7;
|
public static final int MINOR = 7;
|
||||||
public static final int PATCH = 3;
|
public static final int PATCH = 3;
|
||||||
public static final String PRERELEASE = "beta";
|
public static final String PRERELEASE = "beta";
|
||||||
public static final String BUILDMETA = "712";
|
public static final String BUILDMETA = "714";
|
||||||
public static final String VERSION = "0.7.3-beta+712";
|
public static final String VERSION = "0.7.3-beta+714";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the default constructor.
|
* Disables the default constructor.
|
||||||
|
|
|
@ -100,6 +100,10 @@ public final class Commands {
|
||||||
* The me command.
|
* The me command.
|
||||||
*/
|
*/
|
||||||
static final String ME_CMD = "me";
|
static final String ME_CMD = "me";
|
||||||
|
/**
|
||||||
|
* The modules command.
|
||||||
|
*/
|
||||||
|
static final String MODULES_CMD = "modules";
|
||||||
/**
|
/**
|
||||||
* The msg command.
|
* The msg command.
|
||||||
*/
|
*/
|
||||||
|
@ -133,6 +137,7 @@ public final class Commands {
|
||||||
*/
|
*/
|
||||||
static final String VERSION_CMD = "version";
|
static final String VERSION_CMD = "version";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the default constructor.
|
* Disables the default constructor.
|
||||||
*
|
*
|
||||||
|
|
|
@ -749,8 +749,17 @@ public class Mobibot extends PircBot {
|
||||||
if (isOp(sender)) {
|
if (isOp(sender)) {
|
||||||
send(sender, "The op commands are:");
|
send(sender, "The op commands are:");
|
||||||
send(sender,
|
send(sender,
|
||||||
helpIndent(Commands.CYCLE_CMD + " " + Commands.ME_CMD + " " + Commands.MSG_CMD + " "
|
helpIndent(Commands.CYCLE_CMD
|
||||||
+ Commands.SAY_CMD + " " + Commands.VERSION_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 {
|
} else {
|
||||||
helpResponse(sender, Commands.ME_CMD);
|
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)) {
|
} else if ((cmds.length > 1) && isOp(sender) && Commands.NICK_CMD.equals(cmd)) {
|
||||||
changeNick(args);
|
changeNick(args);
|
||||||
} else if (Commands.SAY_CMD.equals(cmd) && isOp(sender)) {
|
} else if (Commands.SAY_CMD.equals(cmd) && isOp(sender)) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Mon Mar 23 22:32:51 PDT 2020
|
#Mon Mar 23 23:04:40 PDT 2020
|
||||||
version.buildmeta=712
|
version.buildmeta=714
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=7
|
version.minor=7
|
||||||
version.patch=3
|
version.patch=3
|
||||||
version.prerelease=beta
|
version.prerelease=beta
|
||||||
version.project=mobibot
|
version.project=mobibot
|
||||||
version.semver=0.7.3-beta+712
|
version.semver=0.7.3-beta+714
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue