feat: split ignores into 'ignore messages' and 'ignore entities'
This commit is contained in:
parent
d48ab7e16e
commit
0cac964aa6
32 changed files with 730 additions and 488 deletions
|
|
@ -315,19 +315,20 @@ public class GuildMemberUpdateResponder(
|
|||
.WithFooter($"User ID: {member.User.ID}")
|
||||
.WithCurrentTimestamp();
|
||||
|
||||
var addedRoles = member.Roles.Except(oldRoles).Select(s => s.Value).ToList();
|
||||
var removedRoles = oldRoles.Except(member.Roles).Select(s => s.Value).ToList();
|
||||
var addedRoles = member.Roles.Except(oldRoles).ToList();
|
||||
var removedRoles = oldRoles.Except(member.Roles).ToList();
|
||||
|
||||
if (addedRoles.Count != 0)
|
||||
{
|
||||
roleUpdate.AddField("Added", string.Join(", ", addedRoles.Select(id => $"<@&{id}>")));
|
||||
|
||||
// Add all added key roles to the log
|
||||
if (!addedRoles.Except(guildConfig.KeyRoles).Any())
|
||||
if (!addedRoles.Select(s => s.Value).Except(guildConfig.KeyRoles).Any())
|
||||
{
|
||||
var value = string.Join(
|
||||
"\n",
|
||||
addedRoles
|
||||
.Select(s => s.Value)
|
||||
.Where(guildConfig.KeyRoles.Contains)
|
||||
.Select(id =>
|
||||
{
|
||||
|
|
@ -348,11 +349,12 @@ public class GuildMemberUpdateResponder(
|
|||
);
|
||||
|
||||
// Add all removed key roles to the log
|
||||
if (!removedRoles.Except(guildConfig.KeyRoles).Any())
|
||||
if (!removedRoles.Select(s => s.Value).Except(guildConfig.KeyRoles).Any())
|
||||
{
|
||||
var value = string.Join(
|
||||
"\n",
|
||||
removedRoles
|
||||
.Select(s => s.Value)
|
||||
.Where(guildConfig.KeyRoles.Contains)
|
||||
.Select(id =>
|
||||
{
|
||||
|
|
@ -369,8 +371,12 @@ public class GuildMemberUpdateResponder(
|
|||
if (roleUpdate.Fields.Count != 0)
|
||||
{
|
||||
webhookExecutor.QueueLog(
|
||||
guildConfig,
|
||||
LogChannelType.GuildMemberUpdate,
|
||||
webhookExecutor.GetLogChannel(
|
||||
guildConfig,
|
||||
LogChannelType.GuildMemberUpdate,
|
||||
// Check for all added and removed roles
|
||||
roleIds: addedRoles.Concat(removedRoles).ToList()
|
||||
),
|
||||
roleUpdate.Build().GetOrThrow()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue