diff --git a/languages/en-GB.yml b/languages/en-GB.yml index 842465fe1..e7dfe20aa 100644 --- a/languages/en-GB.yml +++ b/languages/en-GB.yml @@ -195,6 +195,7 @@ label: rewards: "Rewards" sendToChat: "Send in Chat" avatar: "Avatar" + footerMessage: "Requested by %s - %s" message: default: usage: "Usage {guild_prefix}%s." diff --git a/src/main/java/de/presti/ree6/audio/AudioPlayerReceiveHandler.java b/src/main/java/de/presti/ree6/audio/AudioPlayerReceiveHandler.java index b5bd50ce7..91b15be23 100644 --- a/src/main/java/de/presti/ree6/audio/AudioPlayerReceiveHandler.java +++ b/src/main/java/de/presti/ree6/audio/AudioPlayerReceiveHandler.java @@ -94,7 +94,7 @@ public AudioPlayerReceiveHandler(Member member, AudioChannelUnion audioChannelUn message = audioChannelUnion.asGuildMessageChannel().sendMessageEmbeds(new EmbedBuilder() .setDescription(LanguageService.getByGuild(member.getGuild(), "message.recording.started")) .setColor(Color.YELLOW) - .setFooter("Requested by " + member.getEffectiveName() + " - " + BotConfig.getAdvertisement(), member.getEffectiveAvatarUrl()) + .setFooter(LanguageService.getByGuild(member.getGuild(),"label.footerMessage", member.getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), member.getEffectiveAvatarUrl()) .setTitle(LanguageService.getByGuild(member.getGuild(), "label.recording.start")) .build()).complete(); diff --git a/src/main/java/de/presti/ree6/commands/CommandManager.java b/src/main/java/de/presti/ree6/commands/CommandManager.java index 9dc4343ae..2598b3ce1 100644 --- a/src/main/java/de/presti/ree6/commands/CommandManager.java +++ b/src/main/java/de/presti/ree6/commands/CommandManager.java @@ -663,7 +663,11 @@ public void sendMessage(EmbedBuilder embedBuilder, int deleteSecond, MessageChan * @param interactionHook the Interaction-hook, if it is a slash event. */ public void deleteMessage(Message message, InteractionHook interactionHook) { - if (message != null && message.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_MANAGE) && message.getChannel().retrieveMessageById(message.getIdLong()).complete() != null && message.getType().canDelete() && !message.isEphemeral() && interactionHook == null) { + if (message != null && message.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_MANAGE) && + message.getChannel().retrieveMessageById(message.getIdLong()).complete() != null && + message.getType().canDelete() && + !message.isEphemeral() && + interactionHook == null) { message.delete().onErrorMap(throwable -> { log.error("[CommandManager] Couldn't delete a Message!", throwable); return null; diff --git a/src/main/java/de/presti/ree6/commands/impl/fun/CatImage.java b/src/main/java/de/presti/ree6/commands/impl/fun/CatImage.java index 6763ecf14..60d94ef4a 100644 --- a/src/main/java/de/presti/ree6/commands/impl/fun/CatImage.java +++ b/src/main/java/de/presti/ree6/commands/impl/fun/CatImage.java @@ -30,7 +30,7 @@ public void onPerform(CommandEvent commandEvent) { em.setTitle(commandEvent.getResource("label.randomCatImage")); em.setColor(BotWorker.randomEmbedColor()); em.setImage(js.get(0).getAsJsonObject().get("url").getAsString()); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/fun/DogImage.java b/src/main/java/de/presti/ree6/commands/impl/fun/DogImage.java index 1afc0917b..13cd2b05c 100644 --- a/src/main/java/de/presti/ree6/commands/impl/fun/DogImage.java +++ b/src/main/java/de/presti/ree6/commands/impl/fun/DogImage.java @@ -29,7 +29,7 @@ public void onPerform(CommandEvent commandEvent) { em.setTitle(commandEvent.getResource("label.randomDogImage")); em.setColor(BotWorker.randomEmbedColor()); em.setImage(js.get("message").getAsString()); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/fun/MemeImage.java b/src/main/java/de/presti/ree6/commands/impl/fun/MemeImage.java index f615fc279..c7f3f13d7 100644 --- a/src/main/java/de/presti/ree6/commands/impl/fun/MemeImage.java +++ b/src/main/java/de/presti/ree6/commands/impl/fun/MemeImage.java @@ -36,7 +36,7 @@ public void onPerform(CommandEvent commandEvent) { em.setDescription(commandEvent.getResource("message.default.retrievalError")); } - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/fun/Monkey.java b/src/main/java/de/presti/ree6/commands/impl/fun/Monkey.java index 5c540366c..81d05b7cc 100644 --- a/src/main/java/de/presti/ree6/commands/impl/fun/Monkey.java +++ b/src/main/java/de/presti/ree6/commands/impl/fun/Monkey.java @@ -25,7 +25,7 @@ public void onPerform(CommandEvent commandEvent) { em.setTitle(commandEvent.getResource("label.monkey")); em.setColor(BotWorker.randomEmbedColor()); em.setImage("https://c.tenor.com/Y89PE1f7exQAAAAd/reject-modernity-return-to-monke.gif"); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/fun/ShibaImage.java b/src/main/java/de/presti/ree6/commands/impl/fun/ShibaImage.java index 9ae1d1d78..b7f7fa266 100644 --- a/src/main/java/de/presti/ree6/commands/impl/fun/ShibaImage.java +++ b/src/main/java/de/presti/ree6/commands/impl/fun/ShibaImage.java @@ -30,7 +30,7 @@ public void onPerform(CommandEvent commandEvent) { em.setTitle(commandEvent.getResource("label.randomShibaImage")); em.setColor(BotWorker.randomEmbedColor()); em.setImage(js.get(0).getAsString()); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); Main.getInstance().getCommandManager().sendMessage(em, commandEvent.getChannel(), commandEvent.getInteractionHook()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/info/Avatar.java b/src/main/java/de/presti/ree6/commands/impl/info/Avatar.java index d250e01b3..7c023ff39 100644 --- a/src/main/java/de/presti/ree6/commands/impl/info/Avatar.java +++ b/src/main/java/de/presti/ree6/commands/impl/info/Avatar.java @@ -77,7 +77,7 @@ public void sendAvatar(User member, CommandEvent commandEvent) { em.setTitle(commandEvent.getResource("label.avatar")); em.setAuthor(member.getEffectiveName() + (UserUtil.isSupporter(member) ? " " : ""), member.getEffectiveAvatarUrl(), member.getEffectiveAvatarUrl()); em.setImage(member.getEffectiveAvatar().getUrl(1024)); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); } diff --git a/src/main/java/de/presti/ree6/commands/impl/info/Info.java b/src/main/java/de/presti/ree6/commands/impl/info/Info.java index a6dd4c092..8e9d1aa28 100644 --- a/src/main/java/de/presti/ree6/commands/impl/info/Info.java +++ b/src/main/java/de/presti/ree6/commands/impl/info/Info.java @@ -89,7 +89,7 @@ public void sendInfo(Member member, CommandEvent commandEvent) { em.addField("**Created Date**", member.getTimeCreated().toLocalDate().format(DateTimeFormatter.ofPattern("dd.MM.yyyy")), true); em.addField("**Joined Date**", member.getTimeJoined().toLocalDate().format(DateTimeFormatter.ofPattern("dd.MM.yyyy")), true); - em.setFooter("Requested by " + commandEvent.getMember().getEffectiveName() + " - " + BotConfig.getAdvertisement(), commandEvent.getMember().getEffectiveAvatarUrl()); + em.setFooter(commandEvent.getResource("label.footerMessage", commandEvent.getMember().getEffectiveAvatarUrl(), BotConfig.getAdvertisement()), commandEvent.getMember().getEffectiveAvatarUrl()); commandEvent.reply(em.build()); }