Skip to content

Commit

Permalink
fix: uint => int
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Mar 2, 2025
1 parent 883ab23 commit 25608db
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions DisCatSharp/Entities/Core/DisCatSharpBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ internal virtual void Validate()
{
if (this.Components.Count > 0)
{
HashSet<uint> ids = [];
Dictionary<uint, List<string>> duplicateIds = [];
HashSet<int> ids = [];
Dictionary<int, List<string>> duplicateIds = [];

foreach (var component in this.Components)
this.CheckComponentIds(component, ids, duplicateIds);
Expand All @@ -213,7 +213,7 @@ internal virtual void Validate()
}
}

private void CheckComponentIds(DiscordComponent component, HashSet<uint> ids, Dictionary<uint, List<string>> duplicateIds)
private void CheckComponentIds(DiscordComponent component, HashSet<int> ids, Dictionary<int, List<string>> duplicateIds)
{
if (component is DiscordActionRowComponent actionRowComponent)
foreach (var actionRowComponentChild in actionRowComponent.Components)
Expand Down Expand Up @@ -245,7 +245,7 @@ private void CheckComponentIds(DiscordComponent component, HashSet<uint> ids, Di
this.AddId(component, ids, duplicateIds);
}

private void AddId(DiscordComponent component, HashSet<uint> ids, Dictionary<uint, List<string>> duplicateIds)
private void AddId(DiscordComponent component, HashSet<int> ids, Dictionary<int, List<string>> duplicateIds)
{
if (component.Id.HasValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public DiscordButtonComponent SetState(bool disabled)
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordButtonComponent WithId(uint id)
public DiscordButtonComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public DiscordLinkButtonComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordLinkButtonComponent WithId(uint id)
public DiscordLinkButtonComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public DiscordPremiumButtonComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordPremiumButtonComponent WithId(uint id)
public DiscordPremiumButtonComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public IReadOnlyCollection<DiscordComponent> Components
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordActionRowComponent WithId(uint id)
public DiscordActionRowComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ internal DiscordActionRowComponentResult()
/// Gets the Id of the compenent. Auto populated by discord if not provided.
/// </summary>
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public uint Id { get; internal set; }
public int Id { get; internal set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ internal DiscordComponent()
/// Gets the Id of the compenent. Auto populated by discord if not provided.
/// </summary>
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public uint? Id { get; internal set; }
public int? Id { get; internal set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ internal DiscordComponentResult()
/// Gets the Id of the compenent. Auto populated by discord if not provided.
/// </summary>
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public uint Id { get; internal set; }
public int Id { get; internal set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public DiscordChannelSelectComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordChannelSelectComponent WithId(uint id)
public DiscordChannelSelectComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public DiscordMentionableSelectComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordMentionableSelectComponent WithId(uint id)
public DiscordMentionableSelectComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public DiscordRoleSelectComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordRoleSelectComponent WithId(uint id)
public DiscordRoleSelectComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public DiscordStringSelectComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordStringSelectComponent WithId(uint id)
public DiscordStringSelectComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public DiscordUserSelectComponent Disable()
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordUserSelectComponent WithId(uint id)
public DiscordUserSelectComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public DiscordTextComponent(TextComponentStyle style, string label, string? cust
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordTextComponent WithId(uint id)
public DiscordTextComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public DiscordContainerComponent AddComponent(DiscordComponent component)
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordContainerComponent WithId(uint id)
public DiscordContainerComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public DiscordFileDisplayComponent(string url, bool? spoiler)
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordFileDisplayComponent WithId(uint id)
public DiscordFileDisplayComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public DiscordMediaGalleryComponent(IEnumerable<DiscordMediaGalleryItem> items)
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordMediaGalleryComponent WithId(uint id)
public DiscordMediaGalleryComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public DiscordSectionComponent WithButtonComponent(DiscordBaseButtonComponent bu
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordSectionComponent WithId(uint id)
public DiscordSectionComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DiscordSeparatorComponent(bool? divider = null, SeparatorSpacingSize? spa
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordSeparatorComponent WithId(uint id)
public DiscordSeparatorComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public DiscordTextDisplayComponent(string content)
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordTextDisplayComponent WithId(uint id)
public DiscordTextDisplayComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal DiscordThumbnailComponent(string url, string? description = null, bool?
/// Assigns a unique id to the components.
/// </summary>
/// <param name="id">The id to assign.</param>
public DiscordThumbnailComponent WithId(uint id)
public DiscordThumbnailComponent WithId(int id)
{
this.Id = id;
return this;
Expand Down
Loading

0 comments on commit 25608db

Please sign in to comment.