Make the bot play Project DIVA
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-08-26 00:39:55 +02:00
parent 00e30bd073
commit a875053435
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package wtf.beatrice.hidekobot;
import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent; import net.dv8tion.jda.api.requests.GatewayIntent;
import wtf.beatrice.hidekobot.listeners.MessageListener; import wtf.beatrice.hidekobot.listeners.MessageListener;
@ -51,7 +52,6 @@ public class HidekoBot
{ {
// try to create the bot object and authenticate it with discord. // try to create the bot object and authenticate it with discord.
JDABuilder jdaBuilder = JDABuilder.createDefault(botToken); JDABuilder jdaBuilder = JDABuilder.createDefault(botToken);
jdaBuilder.setActivity(Activity.playing("the piano"));
// enable necessary intents. // enable necessary intents.
jdaBuilder.enableIntents( jdaBuilder.enableIntents(
@ -75,6 +75,10 @@ public class HidekoBot
jda.addEventListener(new MessageListener()); jda.addEventListener(new MessageListener());
if(Configuration.isVerbose()) jda.addEventListener(new MessageLogger()); 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. // print the bot logo.
logger.log("Ready!\n\n" + logger.getLogo() + "\nv" + version + " - bot is ready!\n", 2); logger.log("Ready!\n\n" + logger.getLogo() + "\nv" + version + " - bot is ready!\n", 2);

View File

@ -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. // 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 guildChannelFormat = "[%guild%] [#%channel%] %user%: %message%";
private final static String dmFormat = "[DM] %user%: %message%"; private final static String dmFormat = "[DM] %user%: %message%";