Make bot announce its prefix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-11-22 21:48:13 +01:00
parent 19100758cb
commit b681acdbca
2 changed files with 14 additions and 3 deletions

View File

@ -16,11 +16,13 @@ public class Cache
{ {
// todo: make this compatible with the message listener's regex
private static final String botPrefix = "hideko";
private static final Logger logger = new Logger(Cache.class); private static final Logger logger = new Logger(Cache.class);
private static ConfigurationSource configurationSource = null; private static ConfigurationSource configurationSource = null;
private static DatabaseSource databaseSource = null; private static DatabaseSource databaseSource = null;
private static boolean verbose = false; private static boolean verbose = false;
private static MessageLogger verbosityLogger; private static MessageLogger verbosityLogger = null;
private static final long botMaintainerId = 979809420714332260L; private static final long botMaintainerId = 979809420714332260L;
private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss"; private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss";
@ -28,7 +30,7 @@ public class Cache
private final static long expiryTimeSeconds = 15L; private final static long expiryTimeSeconds = 15L;
// used to count e.g. uptime // used to count e.g. uptime
private static LocalDateTime startupTime; private static LocalDateTime startupTime = null;
private final static String execPath = System.getProperty("user.dir"); private final static String execPath = System.getProperty("user.dir");
@ -243,4 +245,11 @@ public class Cache
public static void setConfigurationSource(ConfigurationSource configurationSource) public static void setConfigurationSource(ConfigurationSource configurationSource)
{ Cache.configurationSource = configurationSource; } { Cache.configurationSource = configurationSource; }
/**
* Get the bot's prefix
*
* @return a String of the bot's prefix.
*/
public static String getBotPrefix() { return botPrefix; }
} }

View File

@ -24,8 +24,10 @@ public class BotInfo
// help field // help field
long ownerId = Cache.getBotOwnerId(); long ownerId = Cache.getBotOwnerId();
String prefix = Cache.getBotPrefix();
embedBuilder.addField("Getting started", embedBuilder.addField("Getting started",
"This instance is run by <@" + ownerId + ">.\nType `/help` for help! ", "This instance is run by <@" + ownerId + ">.\n" +
"Type `/help` for help! The bot prefix is `" + prefix + "`.",
false); false);
// type-specific commands list field // type-specific commands list field