Start implementing config file

This commit is contained in:
Bea 2022-11-21 20:04:28 +01:00
parent d9d0ce3236
commit 66d27fe1fe
3 changed files with 21 additions and 6 deletions

View File

@ -18,9 +18,8 @@ public class Configuration
private static DatabaseManager dbManager = null; private static DatabaseManager dbManager = null;
private static boolean verbose = false; private static boolean verbose = false;
private static MessageLogger verbosityLogger; private static MessageLogger verbosityLogger;
private static final long botMaintainerId = 979809420714332260L;
// todo: allow people to set their own user id private static long botOwnerId = 0L;
private static final long botOwnerId = 979809420714332260L;
private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss"; private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss";
@ -98,6 +97,14 @@ public class Configuration
*/ */
public static long getBotOwnerId() { return botOwnerId; } public static long getBotOwnerId() { return botOwnerId; }
/**
* Get the bot maintainer's profile id.
*
* @return a long of the account's id
*/
public static long getBotMaintainerId() { return botMaintainerId; }
/** /**
* Set the bot's application id. * Set the bot's application id.
* *

View File

@ -67,9 +67,9 @@ public class BotInfoCommand
DecimalFormat ramMBFormatter = new DecimalFormat("#.##"); DecimalFormat ramMBFormatter = new DecimalFormat("#.##");
embedBuilder.addField("RAM Usage", ramMBFormatter.format(usedRamMB) + " MB", true); embedBuilder.addField("RAM Usage", ramMBFormatter.format(usedRamMB) + " MB", true);
// author field // developer field
String authorMention = "<@" + Configuration.getBotOwnerId() + ">"; String developerMention = "<@" + Configuration.getBotMaintainerId() + ">";
embedBuilder.addField("Author", authorMention, true); embedBuilder.addField("Maintainer", developerMention, true);
// uptime field // uptime field
embedBuilder.addField("Uptime", FormatUtil.getNiceUptime(), true); embedBuilder.addField("Uptime", FormatUtil.getNiceUptime(), true);

View File

@ -0,0 +1,8 @@
bot-settings:
bot-token: 'paste-token-here'
bot-owner-id: 'paste_your_user_id_here'
bot-color: 'PINK'
system-settings:
heartbeat:
enabled: false
link: 'https://your-heartbeat-api.com/api/push/apikey?status=up&msg=OK&ping='