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 Rich IEmbed object to a EmbedBuilder.
public static EmbedBuilder ToEmbedBuilder(this IEmbed embed)
Parameters
embedIEmbed
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
builderEmbedBuilderuserIUser
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
builderEmbedBuilderrbytegbytebbyte
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
builderEmbedBuilderrintgintbint
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
builderEmbedBuilderrfloatgfloatbfloat
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
builderEmbedBuilderrawValueuint
Returns
WithFields(EmbedBuilder, params EmbedFieldBuilder[])
Adds the specified fields into this EmbedBuilder.
public static EmbedBuilder WithFields(this EmbedBuilder builder, params EmbedFieldBuilder[] fields)
Parameters
builderEmbedBuilderfieldsEmbedFieldBuilder[]
Returns
WithFields(EmbedBuilder, IEnumerable<EmbedFieldBuilder>)
Adds the specified fields into this EmbedBuilder.
public static EmbedBuilder WithFields(this EmbedBuilder builder, IEnumerable<EmbedFieldBuilder> fields)
Parameters
builderEmbedBuilderfieldsIEnumerable<EmbedFieldBuilder>
Returns
Exceptions
- ArgumentException
Field count exceeds MaxFieldCount.