Skip to content

Commit

Permalink
Add StickerId to REST and WebSocket Sticker audit log data classes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Spider570 authored Sep 14, 2024
1 parent 7f18f7f commit 8a2ea4b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -19,9 +20,17 @@ internal static StickerCreatedAuditLogData Create(BaseDiscordClient discord, Ent
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -19,9 +20,17 @@ internal static StickerDeletedAuditLogData Create(BaseDiscordClient discord, Ent
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -20,9 +21,17 @@ internal static StickerUpdatedAuditLogData Create(BaseDiscordClient discord, Ent
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -19,9 +20,17 @@ internal static SocketStickerCreatedAuditLogData Create(DiscordSocketClient disc
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -19,9 +20,17 @@ internal static SocketStickerDeletedAuditLogData Create(BaseDiscordClient discor
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -20,9 +21,17 @@ internal static SocketStickerUpdatedAuditLogData Create(DiscordSocketClient disc
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>
Expand Down

0 comments on commit 8a2ea4b

Please sign in to comment.