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
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
EmbedBuilderuser
IUser
Returns
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
EmbedBuilderr
byteg
byteb
byte
Returns
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
EmbedBuilderr
intg
intb
int
Returns
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
EmbedBuilderr
floatg
floatb
float
Returns
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
EmbedBuilderrawValue
uint
Returns
WithFields(EmbedBuilder, params EmbedFieldBuilder[])
Adds the specified fields into this EmbedBuilder.
public static EmbedBuilder WithFields(this EmbedBuilder builder, params EmbedFieldBuilder[] fields)
Parameters
builder
EmbedBuilderfields
EmbedFieldBuilder[]
Returns
WithFields(EmbedBuilder, IEnumerable<EmbedFieldBuilder>)
Adds the specified fields into this EmbedBuilder.
public static EmbedBuilder WithFields(this EmbedBuilder builder, IEnumerable<EmbedFieldBuilder> fields)
Parameters
builder
EmbedBuilderfields
IEnumerable<EmbedFieldBuilder>
Returns
Exceptions
- ArgumentException
Field count exceeds MaxFieldCount.