From a875053435b6c6b1f007cbb34687d09e4a131eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Fri, 26 Aug 2022 00:39:55 +0200 Subject: [PATCH] Make the bot play Project DIVA --- src/main/java/wtf/beatrice/hidekobot/HidekoBot.java | 6 +++++- .../wtf/beatrice/hidekobot/listeners/MessageLogger.java | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java index 1a1791f..c645f78 100644 --- a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java +++ b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java @@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; +import net.dv8tion.jda.api.OnlineStatus; import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.requests.GatewayIntent; import wtf.beatrice.hidekobot.listeners.MessageListener; @@ -51,7 +52,6 @@ public class HidekoBot { // try to create the bot object and authenticate it with discord. JDABuilder jdaBuilder = JDABuilder.createDefault(botToken); - jdaBuilder.setActivity(Activity.playing("the piano")); // enable necessary intents. jdaBuilder.enableIntents( @@ -75,6 +75,10 @@ public class HidekoBot jda.addEventListener(new MessageListener()); if(Configuration.isVerbose()) jda.addEventListener(new MessageLogger()); + // set the bot's status + jda.getPresence().setStatus(OnlineStatus.ONLINE); + jda.getPresence().setActivity(Activity.playing("Hatsune Miku: Project DIVA")); + // print the bot logo. logger.log("Ready!\n\n" + logger.getLogo() + "\nv" + version + " - bot is ready!\n", 2); diff --git a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java index f393f18..71bebd6 100644 --- a/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java +++ b/src/main/java/wtf/beatrice/hidekobot/listeners/MessageLogger.java @@ -12,7 +12,6 @@ public class MessageLogger extends ListenerAdapter { // this class only gets loaded as a listener if verbosity is set to true on startup. - private final static String guildChannelFormat = "[%guild%] [#%channel%] %user%: %message%"; private final static String dmFormat = "[DM] %user%: %message%";