Do not delete messages from role-muted members

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-02-02 19:51:55 +05:00
parent 8518db5b2f
commit 8f9c71edf1
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -18,9 +18,9 @@ public sealed class CommandProcessor {
}; };
private readonly StringBuilder _stackedPrivateFeedback = new(); private readonly StringBuilder _stackedPrivateFeedback = new();
private readonly StringBuilder _stackedPublicFeedback = new(); private readonly StringBuilder _stackedPublicFeedback = new();
private readonly StringBuilder _stackedReplyMessage = new(); private readonly StringBuilder _stackedReplyMessage = new();
private readonly List<Task> _tasks = new(); private readonly List<Task> _tasks = new();
public readonly SocketCommandContext Context; public readonly SocketCommandContext Context;
@ -35,11 +35,6 @@ public sealed class CommandProcessor {
var data = GuildData.Get(guild); var data = GuildData.Get(guild);
Utils.SetCurrentLanguage(guild); Utils.SetCurrentLanguage(guild);
if (GetMember().Roles.Contains(data.MuteRole)) {
_ = Context.Message.DeleteAsync();
return;
}
var list = Context.Message.Content.Split("\n"); var list = Context.Message.Content.Split("\n");
var cleanList = Context.Message.CleanContent.Split("\n"); var cleanList = Context.Message.CleanContent.Split("\n");
for (var i = 0; i < list.Length; i++) for (var i = 0; i < list.Length; i++)