Show / Hide Table of Contents

Class EmbedFieldBuilder

Represents a builder class for an embed field.

Inheritance
System.Object
EmbedFieldBuilder
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public class EmbedFieldBuilder

Fields

| Improve this Doc View Source

MaxFieldNameLength

Gets the maximum field length for name allowed by Discord.

Declaration
public const int MaxFieldNameLength = 256
Field Value
Type Description
System.Int32
| Improve this Doc View Source

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 Source

IsInline

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
| Improve this Doc View Source

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 null, empty or entirely whitespace.

- or -

Field name length exceeds MaxFieldNameLength.

| Improve this Doc View Source

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 null, empty or entirely whitespace.

- or -

Field value length exceeds MaxFieldValueLength.

Methods

| Improve this Doc View Source

Build()

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 null, empty or entirely whitespace.

- or -

Name or Value exceeds the maximum length allowed by Discord.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX