From b853495d6587b58f9b5a88001ec008829b5ee84a Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 11 Aug 2022 16:03:04 +0200 Subject: [PATCH] Added .emojiremove command --- src/NadekoBot/Modules/Utility/Utility.cs | 7 ++++++- src/NadekoBot/data/strings/commands/commands.en-US.yml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 08d4ca54d..fa58edf57 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -374,10 +374,15 @@ public partial class Utility : NadekoModule [Priority(0)] public async Task EmojiRemove(params Emote[] emotes) { + if (emotes.Length == 0) + return; + + var g = (SocketGuild)ctx.Guild; + var fails = new List(); foreach (var emote in emotes) { - var guildEmote = await ctx.Guild.GetEmoteAsync(emote.Id); + var guildEmote = g.Emotes.FirstOrDefault(x => x.Id == emote.Id); if (guildEmote is null) { fails.Add(emote); diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/NadekoBot/data/strings/commands/commands.en-US.yml index e02059d18..4d5e51e80 100644 --- a/src/NadekoBot/data/strings/commands/commands.en-US.yml +++ b/src/NadekoBot/data/strings/commands/commands.en-US.yml @@ -1217,6 +1217,10 @@ emojiadd: - ":someonesCustomEmoji:" - "MyEmojiName :someonesCustomEmoji:" - "owoNice https://cdn.discordapp.com/emojis/587930873811173386.png?size=128" +emojiremove: + desc: "Removes the specified emoji or emojis from this server." + args: + - ":eagleWarrior: :plumedArcher:" deckshuffle: desc: "Reshuffles all cards back into the deck." args: