-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature]
Audit Log Created
gateway event support (#2627)
* add event to socket client * make `AuditLog` param optional * Some WIP audit log changes * api models * moar models * complete models * modelsss * forgot to push * oh lol forgot this too * api & rest guild method * revert VS being VS & formatting to file scoped namespace * socket entities * some work eh * moar stuff - switched to d.net's attribute for audit log deserialization * working socket guild updated event + reworked rest GuildInfo creation * a bit of refactoring + new models * +channel created * channel updated & channel deleted * refactor rest channel updated log + some nullable fixes * rest channel created + deleted logs * user banned socket log * kick + unban * moar log modelsssss * fixes & 4 more log types * overwrite logs * role logs * invite logs * webhook logs * switch to `ISocketAuditLogData` for socket log data * emote logs * move stuff around * move more stuff around * audit logs cache * scheduled event logs * thread logs * command permission update audit log * fetch scheduled event data from log * integration audit logs * sticker audit log data * stage instance audit logs * auto mod rule audit logs * fix * forgot couple props * command perm updated data from options * final automod ones * debugging goes away :( * merge cringe * ... * yup * fix xml doc * onboarding audit logs * changes --------- Co-authored-by: cat <lumitydev@gmail.com>
- Loading branch information
1 parent
3a8f76c
commit dff6a57
Showing
181 changed files
with
8,890 additions
and
2,703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/Discord.Net.Core/Entities/AuditLogs/IAuditLogInfoModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Discord; | ||
|
||
public interface IAuditLogInfoModel | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Discord.Net.Rest/API/AuditLogs/AutoModRuleInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class AutoModRuleInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonField("event_type")] | ||
public AutoModEventType EventType { get; set; } | ||
|
||
[JsonField("trigger_type")] | ||
public AutoModTriggerType TriggerType { get; set; } | ||
|
||
[JsonField("trigger_metadata")] | ||
public TriggerMetadata TriggerMetadata { get; set; } | ||
|
||
[JsonField("actions")] | ||
public AutoModAction[] Actions { get; set; } | ||
|
||
[JsonField("enabled")] | ||
public bool Enabled { get; set; } | ||
|
||
[JsonField("exempt_roles")] | ||
public ulong[] ExemptRoles { get; set; } | ||
|
||
[JsonField("exempt_channels")] | ||
public ulong[] ExemptChannels { get; set; } | ||
} |
57 changes: 57 additions & 0 deletions
57
src/Discord.Net.Rest/API/AuditLogs/ChannelInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class ChannelInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonField("type")] | ||
public ChannelType? Type { get; set; } | ||
|
||
[JsonField("permission_overwrites")] | ||
public Overwrite[] Overwrites { get; set; } | ||
|
||
[JsonField("flags")] | ||
public ChannelFlags? Flags { get; set; } | ||
|
||
[JsonField("default_thread_rate_limit_per_user")] | ||
public int? DefaultThreadRateLimitPerUser { get; set; } | ||
|
||
[JsonField("default_auto_archive_duration")] | ||
public ThreadArchiveDuration? DefaultArchiveDuration { get; set; } | ||
|
||
[JsonField("rate_limit_per_user")] | ||
public int? RateLimitPerUser { get; set; } | ||
|
||
[JsonField("auto_archive_duration")] | ||
public ThreadArchiveDuration? AutoArchiveDuration { get; set; } | ||
|
||
[JsonField("nsfw")] | ||
public bool? IsNsfw { get; set; } | ||
|
||
[JsonField("topic")] | ||
public string Topic { get; set; } | ||
|
||
// Forum channels | ||
[JsonField("available_tags")] | ||
public ForumTag[] AvailableTags { get; set; } | ||
|
||
[JsonField("default_reaction_emoji")] | ||
public ForumReactionEmoji DefaultEmoji { get; set; } | ||
|
||
// Voice channels | ||
|
||
[JsonField("user_limit")] | ||
public int? UserLimit { get; set; } | ||
|
||
[JsonField("rtc_region")] | ||
public string Region { get; set; } | ||
|
||
[JsonField("video_quality_mode")] | ||
public VideoQualityMode? VideoQualityMode { get; set; } | ||
|
||
[JsonField("bitrate")] | ||
public int? Bitrate { get; set; } | ||
} |
82 changes: 82 additions & 0 deletions
82
src/Discord.Net.Rest/API/AuditLogs/GuildInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
public class GuildInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonField("afk_timeout")] | ||
public int? AfkTimeout { get; set; } | ||
|
||
[JsonField("widget_enabled")] | ||
public bool? IsEmbeddable { get; set; } | ||
|
||
[JsonField("default_message_notifications")] | ||
public DefaultMessageNotifications? DefaultMessageNotifications { get; set; } | ||
|
||
[JsonField("mfa_level")] | ||
public MfaLevel? MfaLevel { get; set; } | ||
|
||
[JsonField("verification_level")] | ||
public VerificationLevel? VerificationLevel { get; set; } | ||
|
||
[JsonField("explicit_content_filter")] | ||
public ExplicitContentFilterLevel? ExplicitContentFilterLevel { get; set; } | ||
|
||
[JsonField("icon_hash")] | ||
public string IconHash { get; set; } | ||
|
||
[JsonField("discovery_splash")] | ||
public string DiscoverySplash { get; set; } | ||
|
||
[JsonField("splash")] | ||
public string Splash { get; set; } | ||
|
||
[JsonField("afk_channel_id")] | ||
public ulong? AfkChannelId { get; set; } | ||
|
||
[JsonField("widget_channel_id")] | ||
public ulong? EmbeddedChannelId { get; set; } | ||
|
||
[JsonField("system_channel_id")] | ||
public ulong? SystemChannelId { get; set; } | ||
|
||
[JsonField("rules_channel_id")] | ||
public ulong? RulesChannelId { get; set; } | ||
|
||
[JsonField("public_updates_channel_id")] | ||
public ulong? PublicUpdatesChannelId { get; set; } | ||
|
||
[JsonField("owner_id")] | ||
public ulong? OwnerId { get; set; } | ||
|
||
[JsonField("application_id")] | ||
public ulong? ApplicationId { get; set; } | ||
|
||
[JsonField("region")] | ||
public string RegionId { get; set; } | ||
|
||
[JsonField("banner")] | ||
public string Banner { get; set; } | ||
|
||
[JsonField("vanity_url_code")] | ||
public string VanityUrl { get; set; } | ||
|
||
[JsonField("system_channel_flags")] | ||
public SystemChannelMessageDeny? SystemChannelFlags { get; set; } | ||
|
||
[JsonField("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonField("preferred_locale")] | ||
public string PreferredLocale { get; set; } | ||
|
||
[JsonField("nsfw_level")] | ||
public NsfwLevel? NsfwLevel { get; set; } | ||
|
||
[JsonField("premium_progress_bar_enabled")] | ||
public bool? ProgressBarEnabled { get; set; } | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/Discord.Net.Rest/API/AuditLogs/IntegrationInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class IntegrationInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonField("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonField("enabled")] | ||
public bool? Enabled { get; set; } | ||
|
||
[JsonField("syncing")] | ||
public bool? Syncing { get; set; } | ||
|
||
[JsonField("role_id")] | ||
public ulong? RoleId { get; set; } | ||
|
||
[JsonField("enable_emoticons")] | ||
public bool? EnableEmojis { get; set; } | ||
|
||
[JsonField("expire_behavior")] | ||
public IntegrationExpireBehavior? ExpireBehavior { get; set; } | ||
|
||
[JsonField("expire_grace_period")] | ||
public int? ExpireGracePeriod { get; set; } | ||
|
||
[JsonField("scopes")] | ||
public string[] Scopes { get; set; } | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Discord.Net.Rest/API/AuditLogs/InviteInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class InviteInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("code")] | ||
public string Code { get; set; } | ||
|
||
[JsonField("channel_id")] | ||
public ulong? ChannelId { get; set; } | ||
|
||
[JsonField("inviter_id")] | ||
public ulong? InviterId { get; set; } | ||
|
||
[JsonField("uses")] | ||
public int? Uses { get; set; } | ||
|
||
[JsonField("max_uses")] | ||
public int? MaxUses { get; set; } | ||
|
||
[JsonField("max_age")] | ||
public int? MaxAge { get; set; } | ||
|
||
[JsonField("temporary")] | ||
public bool? Temporary { get; set; } | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Discord.Net.Rest/API/AuditLogs/MemberInfoAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Discord.Rest; | ||
using System; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class MemberInfoAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("nick")] | ||
public string Nickname { get; set; } | ||
|
||
[JsonField("mute")] | ||
public bool? IsMuted { get; set; } | ||
|
||
[JsonField("deaf")] | ||
public bool? IsDeafened { get; set; } | ||
|
||
[JsonField("communication_disabled_until")] | ||
public DateTimeOffset? TimeOutUntil { get; set; } | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Discord.Net.Rest/API/AuditLogs/OnboardingAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class OnboardingAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("default_channel_ids")] | ||
public ulong[] DefaultChannelIds { get; set; } | ||
|
||
[JsonField("prompts")] | ||
public GuildOnboardingPrompt[] Prompts { get; set; } | ||
|
||
[JsonField("enabled")] | ||
public bool? Enabled { get; set; } | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Discord.Net.Rest/API/AuditLogs/OnboardingPromptAuditLogModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Discord.Rest; | ||
|
||
namespace Discord.API.AuditLogs; | ||
|
||
internal class OnboardingPromptAuditLogModel : IAuditLogInfoModel | ||
{ | ||
[JsonField("id")] | ||
public ulong? Id { get; set; } | ||
|
||
[JsonField("title")] | ||
public string Title { get; set; } | ||
|
||
[JsonField("options")] | ||
public GuildOnboardingPromptOption[] Options { get; set; } | ||
|
||
[JsonField("single_select")] | ||
public bool? IsSingleSelect { get; set; } | ||
|
||
[JsonField("required")] | ||
public bool? IsRequired { get; set; } | ||
|
||
[JsonField("in_onboarding")] | ||
public bool? IsInOnboarding { get; set; } | ||
|
||
[JsonField("type")] | ||
public GuildOnboardingPromptType? Type { get; set; } | ||
} |
Oops, something went wrong.