allow banner and avatar command to be global

This commit is contained in:
Lee 2024-06-28 19:03:02 +01:00
parent 290c25ee43
commit fa205d7ff2
4 changed files with 2 additions and 4 deletions

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
* @author Nick (okNick) * @author Nick (okNick)
*/ */
@Component @Component
@CommandInfo(name = "avatar", description = "View the avatar of the guild or a user") @CommandInfo(name = "avatar", description = "View the avatar of the guild or a user", guildOnly = false)
public class AvatarCommand extends BatCommand { public class AvatarCommand extends BatCommand {
@Autowired @Autowired
public AvatarCommand(@NonNull ApplicationContext context) { public AvatarCommand(@NonNull ApplicationContext context) {

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
* @author Nick (okNick) * @author Nick (okNick)
*/ */
@Component @Component
@CommandInfo(name = "banner", description = "View the banner of the guild or a user") @CommandInfo(name = "banner", description = "View the banner of the guild or a user", guildOnly = false)
public class BannerCommand extends BatCommand { public class BannerCommand extends BatCommand {
@Autowired @Autowired
public BannerCommand(@NonNull ApplicationContext context) { public BannerCommand(@NonNull ApplicationContext context) {

@ -21,7 +21,6 @@ public class GuildSubCommand extends BatSubCommand {
@Override @Override
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) { public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
ImageProxy banner = guild.getDiscordGuild().getBanner(); ImageProxy banner = guild.getDiscordGuild().getBanner();
if (banner == null) { if (banner == null) {
interaction.replyEmbeds(EmbedUtils.errorEmbed() interaction.replyEmbeds(EmbedUtils.errorEmbed()
.setDescription("%s does not have a banner!".formatted(guild.getName())) .setDescription("%s does not have a banner!".formatted(guild.getName()))

@ -38,7 +38,6 @@ public class UserSubCommand extends BatSubCommand {
User target = userOption.getAsUser(); User target = userOption.getAsUser();
ImageProxy banner = target.retrieveProfile().complete().getBanner(); ImageProxy banner = target.retrieveProfile().complete().getBanner();
if (banner == null) { if (banner == null) {
interaction.replyEmbeds(EmbedUtils.errorEmbed() interaction.replyEmbeds(EmbedUtils.errorEmbed()
.setDescription("%s does not have a banner!".formatted(target.getName())) .setDescription("%s does not have a banner!".formatted(target.getName()))