Add StickerId to REST and WebSocket Sticker audit log data classes (#3005)

This commit is contained in:
Spider
2024-09-14 09:24:35 -07:00
committed by GitHub
parent 7f18f7f5f0
commit 8a2ea4bb58
6 changed files with 66 additions and 12 deletions

View File

@@ -9,8 +9,9 @@ namespace Discord.Rest;
/// </summary>
public class StickerCreatedAuditLogData : IAuditLogData
{
internal StickerCreatedAuditLogData(StickerInfo data)
internal StickerCreatedAuditLogData(ulong id, StickerInfo data)
{
StickerId = id;
Data = data;
}
@@ -19,9 +20,17 @@ public class StickerCreatedAuditLogData : IAuditLogData
var changes = entry.Changes;
var (_, data) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new StickerCreatedAuditLogData(new(data));
return new StickerCreatedAuditLogData(entry.TargetId.Value, new(data));
}
/// <summary>
/// Gets the snowflake ID of the created sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the created sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information after the changes.
/// </summary>

View File

@@ -9,8 +9,9 @@ namespace Discord.Rest;
/// </summary>
public class StickerDeletedAuditLogData : IAuditLogData
{
internal StickerDeletedAuditLogData(StickerInfo data)
internal StickerDeletedAuditLogData(ulong id, StickerInfo data)
{
StickerId = id;
Data = data;
}
@@ -19,9 +20,17 @@ public class StickerDeletedAuditLogData : IAuditLogData
var changes = entry.Changes;
var (data, _) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new StickerDeletedAuditLogData(new(data));
return new StickerDeletedAuditLogData(entry.TargetId.Value, new(data));
}
/// <summary>
/// Gets the snowflake ID of the deleted sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the deleted sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information before the changes.
/// </summary>

View File

@@ -9,8 +9,9 @@ namespace Discord.Rest;
/// </summary>
public class StickerUpdatedAuditLogData : IAuditLogData
{
internal StickerUpdatedAuditLogData(StickerInfo before, StickerInfo after)
internal StickerUpdatedAuditLogData(ulong id, StickerInfo before, StickerInfo after)
{
StickerId = id;
Before = before;
After = after;
}
@@ -20,9 +21,17 @@ public class StickerUpdatedAuditLogData : IAuditLogData
var changes = entry.Changes;
var (before, after) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new StickerUpdatedAuditLogData(new(before), new (after));
return new StickerUpdatedAuditLogData(entry.TargetId.Value, new(before), new (after));
}
/// <summary>
/// Gets the snowflake ID of the updated sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the updated sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information before the changes.
/// </summary>

View File

@@ -9,8 +9,9 @@ namespace Discord.WebSocket;
/// </summary>
public class SocketStickerCreatedAuditLogData : ISocketAuditLogData
{
internal SocketStickerCreatedAuditLogData(SocketStickerInfo data)
internal SocketStickerCreatedAuditLogData(ulong id, SocketStickerInfo data)
{
StickerId = id;
Data = data;
}
@@ -19,9 +20,17 @@ public class SocketStickerCreatedAuditLogData : ISocketAuditLogData
var changes = entry.Changes;
var (_, data) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new SocketStickerCreatedAuditLogData(new(data));
return new SocketStickerCreatedAuditLogData(entry.TargetId.Value, new(data));
}
/// <summary>
/// Gets the snowflake ID of the created sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the created sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information after the changes.
/// </summary>

View File

@@ -9,8 +9,9 @@ namespace Discord.WebSocket;
/// </summary>
public class SocketStickerDeletedAuditLogData : ISocketAuditLogData
{
internal SocketStickerDeletedAuditLogData(SocketStickerInfo data)
internal SocketStickerDeletedAuditLogData(ulong id, SocketStickerInfo data)
{
StickerId = id;
Data = data;
}
@@ -19,9 +20,17 @@ public class SocketStickerDeletedAuditLogData : ISocketAuditLogData
var changes = entry.Changes;
var (data, _) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new SocketStickerDeletedAuditLogData(new(data));
return new SocketStickerDeletedAuditLogData(entry.TargetId.Value, new(data));
}
/// <summary>
/// Gets the snowflake ID of the deleted sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the deleted sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information before the changes.
/// </summary>

View File

@@ -9,8 +9,9 @@ namespace Discord.WebSocket;
/// </summary>
public class SocketStickerUpdatedAuditLogData : ISocketAuditLogData
{
internal SocketStickerUpdatedAuditLogData(SocketStickerInfo before, SocketStickerInfo after)
internal SocketStickerUpdatedAuditLogData(ulong id, SocketStickerInfo before, SocketStickerInfo after)
{
StickerId = id;
Before = before;
After = after;
}
@@ -20,9 +21,17 @@ public class SocketStickerUpdatedAuditLogData : ISocketAuditLogData
var changes = entry.Changes;
var (before, after) = AuditLogHelper.CreateAuditLogEntityInfo<StickerInfoAuditLogModel>(changes, discord);
return new SocketStickerUpdatedAuditLogData(new(before), new (after));
return new SocketStickerUpdatedAuditLogData(entry.TargetId.Value, new(before), new (after));
}
/// <summary>
/// Gets the snowflake ID of the updated sticker.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the updated sticker.
/// </returns>
public ulong StickerId { get; }
/// <summary>
/// Gets the sticker information before the changes.
/// </summary>