Class EmbedFieldBuilder
A builder for creating embed fields with validation. Based on Fluxer.Net's EmbedFieldBuilder implementation.
public class EmbedFieldBuilder
- Inheritance
-
objectEmbedFieldBuilder
Properties
IsInline
Gets or sets whether the field should be inline.
public bool IsInline { get; set; }
Property Value
MaxFieldNameLength
Maximum length of the field name.
public static int MaxFieldNameLength { get; }
Property Value
MaxFieldValueLength
Maximum length of the field value.
public static int MaxFieldValueLength { get; }
Property Value
Name
Gets or sets the name of the field.
public string? Name { get; set; }
Property Value
Exceptions
- ArgumentException
Name length exceeds MaxFieldNameLength.
Value
Gets or sets the value of the field.
public string? Value { get; set; }
Property Value
Exceptions
- ArgumentException
Value length exceeds MaxFieldValueLength.
Methods
Build()
Builds the embed field.
public EmbedFieldRequest Build()
Returns
- EmbedFieldRequest
A new Fluxer.Net.EmbedFieldJson object.
Exceptions
- InvalidOperationException
Name or Value is null or empty.
WithIsInline(bool)
Sets whether the field should be inline.
public EmbedFieldBuilder WithIsInline(bool isInline)
Parameters
isInlineboolWhether the field should be inline.
Returns
- EmbedFieldBuilder
The current builder.
WithName(string)
Sets the name of the field.
public EmbedFieldBuilder WithName(string name)
Parameters
namestringThe name to set.
Returns
- EmbedFieldBuilder
The current builder.
WithValue(object)
Sets the value of the field.
public EmbedFieldBuilder WithValue(object value)
Parameters
valueobjectThe value to set.
Returns
- EmbedFieldBuilder
The current builder.