From 6f1c1b61057aebedb7edb1cf7b0f72ec0cdcf1ae Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Tue, 12 Sep 2023 03:25:01 +0200 Subject: [PATCH] fix: ignore missing audit log stuff for now --- .../Entities/Guild/DiscordGuild.AuditLog.cs | 14 ++++++++++++-- DisCatSharp/Enums/Guild/AuditLogActionType.cs | 9 ++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs index e6f9a5f2f8..b371308d60 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs @@ -1353,6 +1353,16 @@ PropertyChange GetChannelChange() case AuditLogActionType.AutoModerationQuarantineUser: break; + case AuditLogActionType.OnboardingQuestionCreate: + case AuditLogActionType.OnboardingQuestionUpdate: + case AuditLogActionType.OnboardingUpdate: + case AuditLogActionType.ServerGuideCreate: + case AuditLogActionType.ServerGuideUpdate: + break; + + case AuditLogActionType.VoiceChannelStatusUpdate: + break; + default: this.Discord.Logger.LogWarning(LoggerEvents.AuditLog, "Unknown audit log action type: {Key} - this should be reported to library developers", (int)xac.ActionType); break; @@ -1363,9 +1373,9 @@ PropertyChange GetChannelChange() entry.ActionCategory = xac.ActionType switch { - AuditLogActionType.ChannelCreate or AuditLogActionType.EmojiCreate or AuditLogActionType.InviteCreate or AuditLogActionType.OverwriteCreate or AuditLogActionType.RoleCreate or AuditLogActionType.WebhookCreate or AuditLogActionType.IntegrationCreate or AuditLogActionType.StickerCreate or AuditLogActionType.StageInstanceCreate or AuditLogActionType.ThreadCreate or AuditLogActionType.GuildScheduledEventCreate or AuditLogActionType.AutoModerationRuleCreate => AuditLogActionCategory.Create, + AuditLogActionType.ChannelCreate or AuditLogActionType.EmojiCreate or AuditLogActionType.InviteCreate or AuditLogActionType.OverwriteCreate or AuditLogActionType.RoleCreate or AuditLogActionType.WebhookCreate or AuditLogActionType.IntegrationCreate or AuditLogActionType.StickerCreate or AuditLogActionType.StageInstanceCreate or AuditLogActionType.ThreadCreate or AuditLogActionType.GuildScheduledEventCreate or AuditLogActionType.AutoModerationRuleCreate or AuditLogActionType.OnboardingQuestionCreate or AuditLogActionType.ServerGuideCreate => AuditLogActionCategory.Create, AuditLogActionType.ChannelDelete or AuditLogActionType.EmojiDelete or AuditLogActionType.InviteDelete or AuditLogActionType.MessageDelete or AuditLogActionType.MessageBulkDelete or AuditLogActionType.OverwriteDelete or AuditLogActionType.RoleDelete or AuditLogActionType.WebhookDelete or AuditLogActionType.IntegrationDelete or AuditLogActionType.StickerDelete or AuditLogActionType.StageInstanceDelete or AuditLogActionType.ThreadDelete or AuditLogActionType.GuildScheduledEventDelete or AuditLogActionType.AutoModerationRuleDelete => AuditLogActionCategory.Delete, - AuditLogActionType.ChannelUpdate or AuditLogActionType.EmojiUpdate or AuditLogActionType.InviteUpdate or AuditLogActionType.MemberRoleUpdate or AuditLogActionType.MemberUpdate or AuditLogActionType.OverwriteUpdate or AuditLogActionType.RoleUpdate or AuditLogActionType.WebhookUpdate or AuditLogActionType.IntegrationUpdate or AuditLogActionType.StickerUpdate or AuditLogActionType.StageInstanceUpdate or AuditLogActionType.ThreadUpdate or AuditLogActionType.GuildScheduledEventUpdate or AuditLogActionType.AutoModerationRuleUpdate => AuditLogActionCategory.Update, + AuditLogActionType.ChannelUpdate or AuditLogActionType.EmojiUpdate or AuditLogActionType.InviteUpdate or AuditLogActionType.MemberRoleUpdate or AuditLogActionType.MemberUpdate or AuditLogActionType.OverwriteUpdate or AuditLogActionType.RoleUpdate or AuditLogActionType.WebhookUpdate or AuditLogActionType.IntegrationUpdate or AuditLogActionType.StickerUpdate or AuditLogActionType.StageInstanceUpdate or AuditLogActionType.ThreadUpdate or AuditLogActionType.GuildScheduledEventUpdate or AuditLogActionType.AutoModerationRuleUpdate or AuditLogActionType.OnboardingQuestionUpdate or AuditLogActionType.OnboardingUpdate or AuditLogActionType.ServerGuideUpdate or AuditLogActionType.VoiceChannelStatusUpdate => AuditLogActionCategory.Update, _ => AuditLogActionCategory.Other, }; entry.Discord = this.Discord; diff --git a/DisCatSharp/Enums/Guild/AuditLogActionType.cs b/DisCatSharp/Enums/Guild/AuditLogActionType.cs index 38a0d478f6..32a1836660 100644 --- a/DisCatSharp/Enums/Guild/AuditLogActionType.cs +++ b/DisCatSharp/Enums/Guild/AuditLogActionType.cs @@ -305,5 +305,12 @@ public enum AuditLogActionType /// /// Indicates that automod quarantined a user. /// - AutoModerationQuarantineUser = 146 + AutoModerationQuarantineUser = 146, + + OnboardingQuestionCreate = 163, + OnboardingQuestionUpdate = 164, + OnboardingUpdate = 167, + ServerGuideCreate = 190, + ServerGuideUpdate = 191, + VoiceChannelStatusUpdate = 192 }