Added .emojiremove

This commit is contained in:
Kwoth
2022-08-11 15:56:07 +02:00
parent f7e0e635e6
commit 0ff02cede9
3 changed files with 38 additions and 0 deletions

View File

@@ -367,6 +367,36 @@ public partial class Utility : NadekoModule
await ConfirmLocalizedAsync(strs.emoji_added(em.ToString()));
}
[Cmd]
[RequireContext(ContextType.Guild)]
[BotPerm(GuildPerm.ManageEmojisAndStickers)]
[UserPerm(GuildPerm.ManageEmojisAndStickers)]
[Priority(0)]
public async Task EmojiRemove(params Emote[] emotes)
{
var fails = new List<Emote>();
foreach (var emote in emotes)
{
var guildEmote = await ctx.Guild.GetEmoteAsync(emote.Id);
if (guildEmote is null)
{
fails.Add(emote);
}
else
{
await ctx.Guild.DeleteEmoteAsync(guildEmote);
}
}
if (fails.Count > 0)
{
await ReplyPendingLocalizedAsync(strs.emoji_not_removed(fails.Select(x => x.ToString()).Join(" ")));
return;
}
await ctx.OkAsync();
}
[Cmd]
[OwnerOnly]
public async Task ListServers(int page = 1)