コード例 #1
0
 /// <summary>
 /// Constucts a new button based on another button.
 /// </summary>
 /// <param name="other">The button to copy.</param>
 public DiscordButtonComponent(DiscordButtonComponent other) : this()
 {
     this.CustomId = other.CustomId;
     this.Style    = other.Style;
     this.Label    = other.Label;
     this.Disabled = other.Disabled;
     this.Emoji    = other.Emoji;
 }
コード例 #2
0
 public DiscordSelectComponentOption(string label, string value, string description = null, bool isDefault = false, DiscordComponentEmoji emoji = null)
 {
     this.Label       = label;
     this.Value       = value;
     this.Description = description;
     this.Default     = isDefault;
     this.Emoji       = emoji;
 }
コード例 #3
0
 /// <summary>
 /// Constructs a new button with the specified options.
 /// </summary>
 /// <param name="style">The style/color of the button.</param>
 /// <param name="customId">The Id to assign to the button. This is sent back when a user presses it.</param>
 /// <param name="label">The text to display on the button, up to 80 characters. Can be left blank if <paramref name="emoji"/>is set.</param>
 /// <param name="disabled">Whether this button should be initialized as being disabled. User sees a greyed out button that cannot be interacted with.</param>
 /// <param name="emoji">The emoji to add to the button. This is required if <paramref name="label"/> is empty or null.</param>
 public DiscordButtonComponent(ButtonStyle style, string customId, string label, bool disabled = false, DiscordComponentEmoji emoji = null)
 {
     this.Style    = style;
     this.Label    = label;
     this.CustomId = customId;
     this.Disabled = disabled;
     this.Emoji    = emoji;
     this.Type     = ComponentType.Button;
 }
コード例 #4
0
 /// <summary>
 /// Constructs a new <see cref="DiscordLinkButtonComponent"/>. This type of button does not send back and interaction when pressed.
 /// </summary>
 /// <param name="url">The url 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>
 public DiscordLinkButtonComponent(string url, string label, bool disabled = false, DiscordComponentEmoji emoji = null) : this()
 {
     this.Url      = url;
     this.Label    = label;
     this.Disabled = disabled;
     this.Emoji    = emoji;
 }