From 66d27fe1fe38ee794d96235de6e0cf3693f6dbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 21 Nov 2022 20:04:28 +0100 Subject: [PATCH] Start implementing config file --- .../java/wtf/beatrice/hidekobot/Configuration.java | 13 ++++++++++--- .../hidekobot/commands/slash/BotInfoCommand.java | 6 +++--- src/main/resources/config.yml | 8 ++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/config.yml diff --git a/src/main/java/wtf/beatrice/hidekobot/Configuration.java b/src/main/java/wtf/beatrice/hidekobot/Configuration.java index e805285..ee9b8b1 100644 --- a/src/main/java/wtf/beatrice/hidekobot/Configuration.java +++ b/src/main/java/wtf/beatrice/hidekobot/Configuration.java @@ -18,9 +18,8 @@ public class Configuration private static DatabaseManager dbManager = null; private static boolean verbose = false; private static MessageLogger verbosityLogger; - - // todo: allow people to set their own user id - private static final long botOwnerId = 979809420714332260L; + private static final long botMaintainerId = 979809420714332260L; + private static long botOwnerId = 0L; private final static String expiryTimestampFormat = "yy/MM/dd HH:mm:ss"; @@ -98,6 +97,14 @@ public class Configuration */ 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. * diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java index 4ec42f8..6602bae 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/BotInfoCommand.java @@ -67,9 +67,9 @@ public class BotInfoCommand DecimalFormat ramMBFormatter = new DecimalFormat("#.##"); embedBuilder.addField("RAM Usage", ramMBFormatter.format(usedRamMB) + " MB", true); - // author field - String authorMention = "<@" + Configuration.getBotOwnerId() + ">"; - embedBuilder.addField("Author", authorMention, true); + // developer field + String developerMention = "<@" + Configuration.getBotMaintainerId() + ">"; + embedBuilder.addField("Maintainer", developerMention, true); // uptime field embedBuilder.addField("Uptime", FormatUtil.getNiceUptime(), true); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..a5a7423 --- /dev/null +++ b/src/main/resources/config.yml @@ -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=' \ No newline at end of file