Class EmbedBuilderExtensions
An extension class for building an embed.
Inheritance
System.Object
EmbedBuilderExtensions
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 static class EmbedBuilderExtensions
Methods
| Improve this Doc View SourceToEmbedBuilder(IEmbed)
Converts a Rich IEmbed object to a EmbedBuilder.
Declaration
public static EmbedBuilder ToEmbedBuilder(this IEmbed embed)
Parameters
| Type | Name | Description |
|---|---|---|
| IEmbed | embed |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
Exceptions
| Type | Condition |
|---|---|
| System.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.
Declaration
public static EmbedBuilder WithAuthor(this EmbedBuilder builder, IUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| IUser | user |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
WithColor(EmbedBuilder, Byte, Byte, Byte)
Adds embed color based on the provided RGB System.Byte value.
Declaration
public static EmbedBuilder WithColor(this EmbedBuilder builder, byte r, byte g, byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| System.Byte | r | |
| System.Byte | g | |
| System.Byte | b |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
WithColor(EmbedBuilder, Int32, Int32, Int32)
Adds embed color based on the provided RGB System.Int32 value.
Declaration
public static EmbedBuilder WithColor(this EmbedBuilder builder, int r, int g, int b)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| System.Int32 | r | |
| System.Int32 | g | |
| System.Int32 | b |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | The argument value is not between 0 to 255. |
WithColor(EmbedBuilder, Single, Single, Single)
Adds embed color based on the provided RGB System.Single value.
Declaration
public static EmbedBuilder WithColor(this EmbedBuilder builder, float r, float g, float b)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| System.Single | r | |
| System.Single | g | |
| System.Single | b |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | The argument value is not between 0 to 1. |
WithColor(EmbedBuilder, UInt32)
Adds embed color based on the provided raw value.
Declaration
public static EmbedBuilder WithColor(this EmbedBuilder builder, uint rawValue)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| System.UInt32 | rawValue |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
WithFields(EmbedBuilder, EmbedFieldBuilder[])
Adds the specified fields into this EmbedBuilder.
Declaration
public static EmbedBuilder WithFields(this EmbedBuilder builder, params EmbedFieldBuilder[] fields)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| EmbedFieldBuilder[] | fields |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
WithFields(EmbedBuilder, IEnumerable<EmbedFieldBuilder>)
Adds the specified fields into this EmbedBuilder.
Declaration
public static EmbedBuilder WithFields(this EmbedBuilder builder, IEnumerable<EmbedFieldBuilder> fields)
Parameters
| Type | Name | Description |
|---|---|---|
| EmbedBuilder | builder | |
| System.Collections.Generic.IEnumerable<EmbedFieldBuilder> | fields |
Returns
| Type | Description |
|---|---|
| EmbedBuilder |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Field count exceeds MaxFieldCount. |