Class EmbedFieldBuilder
Represents a builder class for an embed field.
Inheritance
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public class EmbedFieldBuilder
Fields
| Improve this Doc View SourceMaxFieldNameLength
Gets the maximum field length for name allowed by Discord.
Declaration
public const int MaxFieldNameLength = 256
Field Value
| Type | Description |
|---|---|
| System.Int32 |
MaxFieldValueLength
Gets the maximum field length for value allowed by Discord.
Declaration
public const int MaxFieldValueLength = 1024
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Properties
| Improve this Doc View SourceIsInline
Gets or sets a value that indicates whether the field should be in-line with each other.
Declaration
public bool IsInline { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Name
Gets or sets the field name.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The name of the field. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Field name is
Field name length exceeds MaxFieldNameLength. |
Value
Gets or sets the field value.
Declaration
public object Value { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The value of the field. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Field value is
Field value length exceeds MaxFieldValueLength. |
Methods
| Improve this Doc View SourceBuild()
Builds the field builder into a EmbedField class.
Declaration
public EmbedField Build()
Returns
| Type | Description |
|---|---|
| EmbedField | The current builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Name or Value is
Name or Value exceeds the maximum length allowed by Discord. |
WithIsInline(Boolean)
Determines whether the field should be in-line with each other.
Declaration
public EmbedFieldBuilder WithIsInline(bool isInline)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isInline |
Returns
| Type | Description |
|---|---|
| EmbedFieldBuilder | The current builder. |
WithName(String)
Sets the field name.
Declaration
public EmbedFieldBuilder WithName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name to set the field name to. |
Returns
| Type | Description |
|---|---|
| EmbedFieldBuilder | The current builder. |
WithValue(Object)
Sets the field value.
Declaration
public EmbedFieldBuilder WithValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value to set the field value to. |
Returns
| Type | Description |
|---|---|
| EmbedFieldBuilder | The current builder. |