Skip to content

Commit

Permalink
fix: ignore missing audit log stuff for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Sep 12, 2023
1 parent 5912da2 commit 6f1c1b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
14 changes: 12 additions & 2 deletions DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,16 @@ PropertyChange<DiscordChannel> 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;
Expand All @@ -1363,9 +1373,9 @@ PropertyChange<DiscordChannel> 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;
Expand Down
9 changes: 8 additions & 1 deletion DisCatSharp/Enums/Guild/AuditLogActionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,12 @@ public enum AuditLogActionType
/// <summary>
/// Indicates that automod quarantined a user.
/// </summary>
AutoModerationQuarantineUser = 146
AutoModerationQuarantineUser = 146,

OnboardingQuestionCreate = 163,
OnboardingQuestionUpdate = 164,
OnboardingUpdate = 167,
ServerGuideCreate = 190,
ServerGuideUpdate = 191,
VoiceChannelStatusUpdate = 192
}

0 comments on commit 6f1c1b6

Please sign in to comment.