Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ca0f443
Update AuditLogActionType
Plerx2493 Jul 7, 2023
1e54948
Cleanup var naming, minor refactors (ToArra to avoid multiple enumera…
Plerx2493 Jul 7, 2023
86c4ad6
remove misclick
Plerx2493 Jul 7, 2023
05f85bf
Update AuditLogActionType
Plerx2493 Jul 7, 2023
a656a59
Apply editorconfig
Plerx2493 Jul 7, 2023
d8cf981
Apply editorconfig
Plerx2493 Jul 7, 2023
e83bfb2
Fix Typos and use new()
Plerx2493 Jul 7, 2023
193676b
nuke old auditLog abstraction, add new Auditlogentry types and start …
Plerx2493 Jul 12, 2023
112bbbb
Make PropertyChange a struct and start to split the auditlogentry par…
Plerx2493 Jul 12, 2023
44081d5
fix indentation
Plerx2493 Jul 12, 2023
7945a5c
Continue moving
Plerx2493 Jul 12, 2023
37a8737
Continue moving
Plerx2493 Jul 14, 2023
039029d
Continue moving
Plerx2493 Jul 15, 2023
c900c49
The great moving
Plerx2493 Jul 15, 2023
c1feb74
Add new Event and rename the GuildBan intent to GuildModeration (acco…
Plerx2493 Jul 15, 2023
fa91b17
init Event...
Plerx2493 Jul 15, 2023
38e877a
Fix caches for ResponsibleUser
Plerx2493 Jul 15, 2023
0d3ec22
Use the guild cache
Plerx2493 Jul 15, 2023
938a02c
Update data representation
Plerx2493 Jul 15, 2023
e65e578
Update data representation
Plerx2493 Jul 15, 2023
8f09842
Fix Permission updates
Plerx2493 Jul 15, 2023
8fb7bfd
Add check to minimize api calls
Plerx2493 Jul 16, 2023
19e4ac6
Merge branch 'DSharpPlus:master' into dev/auditlogUpdate
Plerx2493 Jul 16, 2023
174ae5a
Re-added a flag that I had deleted + headers formatting. (#1587)
kubikpatrick Jul 17, 2023
2739da6
System alert channel add (#1588)
kubikpatrick Jul 17, 2023
a5855e3
Handle nullable safety alerts channel ID. (#1597)
akiraveliara Jul 17, 2023
1cf9609
fix: Use `DiscordJson` to deserialize GDMs
VelvetToroyashi Jul 18, 2023
5fce2e4
fix indentation
Plerx2493 Jul 19, 2023
4d9ac95
Merge branch 'master' into dev/auditlogUpdate
Plerx2493 Jul 27, 2023
fee521a
why are you running
Plerx2493 Jul 27, 2023
7a25270
Add missing parser methods
Plerx2493 Aug 11, 2023
05c1200
Finish last parsing Method
Plerx2493 Aug 11, 2023
e61a9bb
Add missing docs and formatting
Plerx2493 Aug 11, 2023
029ddbb
Update and use thread cache
Plerx2493 Aug 11, 2023
6d7e7e5
Rename autogenerated parameter
Plerx2493 Aug 11, 2023
cf77a48
Update PropertyChange
Plerx2493 Aug 11, 2023
cdfcc7f
Adding xmldocs, revert Intent renaming, update method return types
Plerx2493 Aug 12, 2023
7052079
ups
Plerx2493 Aug 12, 2023
e74a1e3
Add toggleable logging
Plerx2493 Aug 12, 2023
a9069d3
Great moving the 2nd
Plerx2493 Aug 12, 2023
907c201
Fix missing init
Plerx2493 Aug 14, 2023
a8403d3
Fix wrong casting and rename member
Plerx2493 Aug 14, 2023
6b62ced
add missing key on threads and integration
Plerx2493 Aug 28, 2023
10ccada
add missing key on automod entries
Plerx2493 Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion DSharpPlus/Clients/DiscordClient.Dispatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ internal async Task HandleDispatchAsync(GatewayPayload payload)

await this.OnGuildIntegrationsUpdateEventAsync(this._guilds[gid]);
break;

case "guild_audit_log_entry_create":
gid = (ulong)dat["guild_id"];
DiscordGuild guild = _guilds[gid];
AuditLogAction auditLogAction = dat.ToDiscordObject<AuditLogAction>();
DiscordAuditLogEntry entry = await AuditLogParser.ParseAuditLogEntryAsync(guild, auditLogAction);
await this.OnGuildAuditLogEntryCreateEventAsync(guild, entry);
break;

#endregion

Expand Down Expand Up @@ -567,7 +575,6 @@ internal async Task HandleDispatchAsync(GatewayPayload payload)
}
}


#endregion

#region Events
Expand Down Expand Up @@ -1214,6 +1221,16 @@ internal async Task OnGuildIntegrationsUpdateEventAsync(DiscordGuild guild)
};
await this._guildIntegrationsUpdated.InvokeAsync(this, ea);
}

private async Task OnGuildAuditLogEntryCreateEventAsync(DiscordGuild guild, DiscordAuditLogEntry auditLogEntry)
{
GuildAuditLogCreatedEventArgs ea = new()
{
Guild = guild,
AuditLogEntry = auditLogEntry
};
await _guildAuditLogCreated.InvokeAsync(this, ea);
}

#endregion

Expand Down
10 changes: 10 additions & 0 deletions DSharpPlus/Clients/DiscordClient.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ public event AsyncEventHandler<DiscordClient, GuildIntegrationsUpdateEventArgs>
}
private AsyncEvent<DiscordClient, GuildIntegrationsUpdateEventArgs> _guildIntegrationsUpdated;

/// <summary>
/// Fired when a audit log entry is created.
/// </summary>
public event AsyncEventHandler<DiscordClient, GuildAuditLogCreatedEventArgs> GuildAuditLogCreated
{
add => this._guildAuditLogCreated.Register(value);
remove => this._guildAuditLogCreated.Unregister(value);
}
private AsyncEvent<DiscordClient, GuildAuditLogCreatedEventArgs> _guildAuditLogCreated;

#endregion

#region Scheduled Guild Events
Expand Down
1 change: 1 addition & 0 deletions DSharpPlus/Clients/DiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ internal void InternalSetup()
this._guildRoleCreated = new AsyncEvent<DiscordClient, GuildRoleCreateEventArgs>("GUILD_ROLE_CREATED", this.EventErrorHandler);
this._guildRoleUpdated = new AsyncEvent<DiscordClient, GuildRoleUpdateEventArgs>("GUILD_ROLE_UPDATED", this.EventErrorHandler);
this._guildRoleDeleted = new AsyncEvent<DiscordClient, GuildRoleDeleteEventArgs>("GUILD_ROLE_DELETED", this.EventErrorHandler);
this._guildAuditLogCreated = new AsyncEvent<DiscordClient, GuildAuditLogCreatedEventArgs>("GUILD_AUDIT_LOG_CREATED", this.EventErrorHandler);
this._messageAcknowledged = new AsyncEvent<DiscordClient, MessageAcknowledgeEventArgs>("MESSAGE_ACKNOWLEDGED", this.EventErrorHandler);
this._messageUpdated = new AsyncEvent<DiscordClient, MessageUpdateEventArgs>("MESSAGE_UPDATED", this.EventErrorHandler);
this._messageDeleted = new AsyncEvent<DiscordClient, MessageDeleteEventArgs>("MESSAGE_DELETED", this.EventErrorHandler);
Expand Down
2 changes: 2 additions & 0 deletions DSharpPlus/DSharpPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>



</Project>
397 changes: 203 additions & 194 deletions DSharpPlus/DiscordConfiguration.cs

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions DSharpPlus/Entities/AuditLogs/AuditLogActionCategory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// This file is part of the DSharpPlus project.
//
// Copyright (c) 2015 Mike Santiago
// Copyright (c) 2016-2023 DSharpPlus Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

namespace DSharpPlus.Entities;

/// <summary>
/// Indicates audit log action category.
/// </summary>
public enum AuditLogActionCategory
{
/// <summary>
/// Indicates that this action resulted in creation or addition of an object.
/// </summary>
Create,

/// <summary>
/// Indicates that this action resulted in update of an object.
/// </summary>
Update,

/// <summary>
/// Indicates that this action resulted in deletion or removal of an object.
/// </summary>
Delete,

/// <summary>
/// Indicates that this action resulted in something else than creation, addition, update, deleteion, or removal of an object.
/// </summary>
Other
}
Loading