diff --git a/src/main/java/de/presti/ree6/bot/BotWorker.java b/src/main/java/de/presti/ree6/bot/BotWorker.java index 5fbb971d8..f6f901c1c 100644 --- a/src/main/java/de/presti/ree6/bot/BotWorker.java +++ b/src/main/java/de/presti/ree6/bot/BotWorker.java @@ -69,13 +69,15 @@ private BotWorker() { */ public static void createBot(BotVersion version1, String build1) throws LoginException { version = version1; - token = BotWorker.version == BotVersion.DEVELOPMENT_BUILD ? Main.getInstance().getConfig().getConfiguration().getString("bot.tokens.dev") : Main.getInstance().getConfig().getConfiguration().getString("bot.tokens.rel"); + token = BotWorker.version == BotVersion.DEVELOPMENT_BUILD ? + Main.getInstance().getConfig().getConfiguration().getString("bot.tokens.dev") : + BotWorker.version == BotVersion.BETA_BUILD ? + Main.getInstance().getConfig().getConfiguration().getString("bot.tokens.beta") : + Main.getInstance().getConfig().getConfiguration().getString("bot.tokens.release"); state = BotState.INIT; build = build1; - shardManager = DefaultShardManagerBuilder.createDefault(token).setShardsTotal(getVersion() == BotVersion.DEVELOPMENT_BUILD ? 1 : 10).enableIntents(GatewayIntent.GUILD_MESSAGES, - GatewayIntent.GUILD_INVITES, GatewayIntent.DIRECT_MESSAGES, GatewayIntent.GUILD_INVITES, GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.MESSAGE_CONTENT, GatewayIntent.GUILD_WEBHOOKS, - GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_BANS).setMemberCachePolicy(MemberCachePolicy.ALL).disableCache(CacheFlag.EMOJI, CacheFlag.ACTIVITY).build(); + shardManager = DefaultShardManagerBuilder.createDefault(token).setShardsTotal(getVersion() == BotVersion.DEVELOPMENT_BUILD ? 1 : 10).enableIntents(GatewayIntent.GUILD_MESSAGES, GatewayIntent.GUILD_INVITES, GatewayIntent.DIRECT_MESSAGES, GatewayIntent.GUILD_INVITES, GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.MESSAGE_CONTENT, GatewayIntent.GUILD_WEBHOOKS, GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_BANS).setMemberCachePolicy(MemberCachePolicy.ALL).disableCache(CacheFlag.EMOJI, CacheFlag.ACTIVITY).build(); } /** @@ -99,8 +101,7 @@ public static void setActivity(String message, Activity.ActivityType activityTyp public static void setActivity(JDA jda, String message, Activity.ActivityType activityType) { // If the Bot Instance is null, if not set. if (jda != null) - jda.getPresence().setActivity(Activity.of(activityType, message.replace("%shards%", shardManager.getShardsTotal() + "") - .replace("%shard%", "" + jda.getShardInfo().getShardId()).replace("%guilds%", shardManager.getGuilds().size() + "").replace("%shard_guilds%", jda.getGuilds().size() + ""))); + jda.getPresence().setActivity(Activity.of(activityType, message.replace("%shards%", shardManager.getShardsTotal() + "").replace("%shard%", "" + jda.getShardInfo().getShardId()).replace("%guilds%", shardManager.getGuilds().size() + "").replace("%shard_guilds%", jda.getGuilds().size() + ""))); } /** @@ -136,6 +137,7 @@ public static Color randomEmbedColor() { /** * Change the current Bot State. + * * @param botState the new {@link BotState} */ public static void setState(BotState botState) { @@ -144,6 +146,7 @@ public static void setState(BotState botState) { /** * Get the current Bot State. + * * @return the {@link BotState}. */ public static BotState getState() { @@ -152,6 +155,7 @@ public static BotState getState() { /** * Get the current Bot Version. + * * @return the {@link BotVersion} */ public static BotVersion getVersion() { @@ -160,6 +164,7 @@ public static BotVersion getVersion() { /** * Get the ShardManager of Ree6. + * * @return the {@link ShardManager} */ public static ShardManager getShardManager() { @@ -168,6 +173,7 @@ public static ShardManager getShardManager() { /** * Get the build / the actual version in the x.y.z format. + * * @return the Build. */ public static String getBuild() { @@ -176,6 +182,7 @@ public static String getBuild() { /** * Set the start Time of the Bot. + * * @param startTime1 the new start Time. */ public static void setStartTime(long startTime1) { @@ -184,6 +191,7 @@ public static void setStartTime(long startTime1) { /** * Get the start Time of the Bot. + * * @return the start Time. */ public static long getStartTime() { diff --git a/src/main/java/de/presti/ree6/utils/data/Config.java b/src/main/java/de/presti/ree6/utils/data/Config.java index 26f09bce6..e62723bd5 100644 --- a/src/main/java/de/presti/ree6/utils/data/Config.java +++ b/src/main/java/de/presti/ree6/utils/data/Config.java @@ -55,6 +55,7 @@ public void init() { yamlFile.addDefault("instagram.password", "yourInstagramPassword"); yamlFile.addDefault("youtube.api.key", "youryoutubeapikey"); yamlFile.addDefault("bot.tokens.rel", "ReleaseTokenhere"); + yamlFile.addDefault("bot.tokens.beta", "BetaTokenhere"); yamlFile.addDefault("bot.tokens.dev", "DevTokenhere"); try {