From 7485bd2ec8166a52ad8489fa67c5f686583d189f Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 1 Jul 2024 01:46:56 +0100 Subject: [PATCH] fix premium admin command --- .../commands/botadmin/premium/RemoveSubCommand.java | 8 ++++---- .../base/commands/botadmin/premium/SetSubCommand.java | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/RemoveSubCommand.java b/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/RemoveSubCommand.java index b73ec94..5c5052e 100644 --- a/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/RemoveSubCommand.java +++ b/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/RemoveSubCommand.java @@ -37,18 +37,18 @@ public class RemoveSubCommand extends BatSubCommand { return; } String guildId = guildOption.getAsString(); - BatGuild batGuild = guildService.getGuild(guildId); - if (batGuild == null) { + BatGuild targetGuild = guildService.getGuild(guildId); + if (targetGuild == null) { interaction.reply("The guild with the id %s does not exist".formatted(guildId)).queue(); return; } - PremiumProfile premium = batGuild.getPremiumProfile(); + PremiumProfile premium = targetGuild.getPremiumProfile(); if (!premium.hasPremium()) { interaction.reply("The guild does not have premium").queue(); return; } premium.removePremium(); - interaction.reply("The guild **%s** has had its premium removed".formatted(guild.getName())).queue(); + interaction.reply("The guild **%s** has had its premium removed".formatted(targetGuild.getName())).queue(); } } diff --git a/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/SetSubCommand.java b/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/SetSubCommand.java index a034d78..4785e54 100644 --- a/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/SetSubCommand.java +++ b/src/main/java/cc/fascinated/bat/features/base/commands/botadmin/premium/SetSubCommand.java @@ -45,21 +45,21 @@ public class SetSubCommand extends BatSubCommand { } boolean infinite = infiniteOption.getAsBoolean(); - BatGuild batGuild = guildService.getGuild(guildId); - if (batGuild == null) { + BatGuild targetGuild = guildService.getGuild(guildId); + if (targetGuild == null) { interaction.reply("The guild with the id %s does not exist".formatted(guildId)).queue(); return; } - PremiumProfile premium = batGuild.getPremiumProfile(); + PremiumProfile premium = targetGuild.getPremiumProfile(); if (!infinite) { premium.addTime(); } else { premium.addInfiniteTime(); } if (!infinite) { - interaction.reply("The guild **%s** has been set as premium until ".formatted(guild.getName(), premium.getExpiresAt().toInstant().toEpochMilli() / 1000)).queue(); + interaction.reply("The guild **%s** has been set as premium until ".formatted(targetGuild.getName(), premium.getExpiresAt().toInstant().toEpochMilli() / 1000)).queue(); } else { - interaction.reply("The guild **%s** has been set as premium indefinitely".formatted(guild.getName())).queue(); + interaction.reply("The guild **%s** has been set as premium indefinitely".formatted(targetGuild.getName())).queue(); } } }