Skip to content

Commit

Permalink
Update DiscordPremiumButtonComponent.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby authored May 30, 2024
1 parent 0eec159 commit e8e346f
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,14 @@ public class DiscordPremiumButtonComponent : DiscordComponent
[JsonProperty("sku_id", NullValueHandling = NullValueHandling.Ignore)]
public ulong SkuId { get; set; }

/// <summary>
/// The text to add to this button. If this is not specified, <see cref="Emoji"/> must be.
/// </summary>
[JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)]
public string Label { get; set; }

/// <summary>
/// Whether this button can be pressed.
/// </summary>
[JsonProperty("disabled", NullValueHandling = NullValueHandling.Ignore)]
public bool Disabled { get; set; }

/// <summary>
/// The emoji to add to the button. Can be used in conjunction with a label, or as standalone. Must be added if label is not specified.
/// The emoji to add to the button.
/// </summary>
[JsonProperty("emoji", NullValueHandling = NullValueHandling.Ignore)]
public DiscordComponentEmoji Emoji { get; set; }
Expand Down Expand Up @@ -65,15 +59,13 @@ public DiscordPremiumButtonComponent Disable()
/// Constructs a new <see cref="DiscordPremiumButtonComponent"/>. This type of button does not send back and interaction when pressed.
/// </summary>
/// <param name="skuId">The sku id to set the button to.</param>
/// <param name="label">The text to display on the button. Can be left blank if <paramref name="emoji"/> is set.</param>
/// <param name="disabled">Whether or not this button can be pressed.</param>
/// <param name="emoji">The emoji to set with this button. This is required if <paramref name="label"/> is null or empty.</param>
/// <param name="emoji">The emoji to set with this button.</param>
[RequiresFeature(Features.MonetizedApplication)]
public DiscordPremiumButtonComponent(ulong skuId, string label, bool disabled = false, DiscordComponentEmoji emoji = null)
public DiscordPremiumButtonComponent(ulong skuId, bool disabled = false, DiscordComponentEmoji emoji = null)
: this()
{
this.SkuId = skuId;
this.Label = label;
this.Disabled = disabled;
this.Emoji = emoji;
}
Expand Down

0 comments on commit e8e346f

Please sign in to comment.