Table of Contents

Class EmbedBuilderExtensions

Namespace
Discord
Assembly
Discord.Net.Core.dll

An extension class for building an embed.

public static class EmbedBuilderExtensions
Inheritance
EmbedBuilderExtensions
Inherited Members

Methods

ToEmbedBuilder(IEmbed)

Converts a RichIEmbed object to a EmbedBuilder.

public static EmbedBuilder ToEmbedBuilder(this IEmbed embed)

Parameters

embed IEmbed

Returns

EmbedBuilder

Exceptions

InvalidOperationException

The embed type is not Rich.

WithAuthor(EmbedBuilder, IUser)

Fills the embed author field with the provided user's full username and avatar URL.

public static EmbedBuilder WithAuthor(this EmbedBuilder builder, IUser user)

Parameters

builder EmbedBuilder
user IUser

Returns

EmbedBuilder

WithColor(EmbedBuilder, byte, byte, byte)

Adds embed color based on the provided RGB byte value.

public static EmbedBuilder WithColor(this EmbedBuilder builder, byte r, byte g, byte b)

Parameters

builder EmbedBuilder
r byte
g byte
b byte

Returns

EmbedBuilder

WithColor(EmbedBuilder, int, int, int)

Adds embed color based on the provided RGB int value.

public static EmbedBuilder WithColor(this EmbedBuilder builder, int r, int g, int b)

Parameters

builder EmbedBuilder
r int
g int
b int

Returns

EmbedBuilder

Exceptions

ArgumentOutOfRangeException

The argument value is not between 0 to 255.

WithColor(EmbedBuilder, float, float, float)

Adds embed color based on the provided RGB float value.

public static EmbedBuilder WithColor(this EmbedBuilder builder, float r, float g, float b)

Parameters

builder EmbedBuilder
r float
g float
b float

Returns

EmbedBuilder

Exceptions

ArgumentOutOfRangeException

The argument value is not between 0 to 1.

WithColor(EmbedBuilder, uint)

Adds embed color based on the provided raw value.

public static EmbedBuilder WithColor(this EmbedBuilder builder, uint rawValue)

Parameters

builder EmbedBuilder
rawValue uint

Returns

EmbedBuilder

WithFields(EmbedBuilder, params EmbedFieldBuilder[])

Adds the specified fields into this EmbedBuilder.

public static EmbedBuilder WithFields(this EmbedBuilder builder, params EmbedFieldBuilder[] fields)

Parameters

builder EmbedBuilder
fields EmbedFieldBuilder[]

Returns

EmbedBuilder

WithFields(EmbedBuilder, IEnumerable<EmbedFieldBuilder>)

Adds the specified fields into this EmbedBuilder.

public static EmbedBuilder WithFields(this EmbedBuilder builder, IEnumerable<EmbedFieldBuilder> fields)

Parameters

builder EmbedBuilder
fields IEnumerable<EmbedFieldBuilder>

Returns

EmbedBuilder

Exceptions

ArgumentException

Field count exceeds MaxFieldCount.