Skip to content

Commit 755c77a

Browse files
committed
fix. if users have access to internals, custom_id gen might skip
1 parent 54cf00c commit 755c77a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

DisCatSharp/Entities/Components/DiscordComponent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23

34
using DisCatSharp.Enums;
@@ -28,7 +29,7 @@ internal DiscordComponent()
2829
/// The custom Id of this component, if applicable. Not applicable on ActionRow(s) and link buttons.
2930
/// </summary>
3031
[JsonProperty("custom_id", NullValueHandling = NullValueHandling.Ignore)]
31-
public string? CustomId { get; internal set; }
32+
public string? CustomId { get; internal set; } = Guid.NewGuid().ToString();
3233

3334
/// <summary>
3435
/// Gets the Id of the compenent. Auto populated by discord if not provided.

0 commit comments

Comments
 (0)