Class DiscordEmbedBuilder
Represents a builder class for creating IDiscordEmbeds.
Inheritance
Inherited Members
Namespace: Color_Chan.Discord.Commands.MessageBuilders
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class DiscordEmbedBuilder
Methods
| Improve this Doc View SourceBuild()
Builds the DiscordEmbed with the current set values.
Declaration
public IDiscordEmbed Build()
Returns
Type | Description |
---|---|
IDiscordEmbed | The generated DiscordEmbed. |
WithAuthor(DiscordEmbedAuthor)
Sets the Author of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithAuthor(DiscordEmbedAuthor author)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedAuthor | author | The author of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithAuthor(String, String, String, String)
Sets the Author of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithAuthor(string name, string url = null, string iconUrl = null, string proxyIconUrl = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the author. |
System.String | url | The url of the author. Default is null. |
System.String | iconUrl | The icon url of the author. only supports http(s) and attachments. Default is null. |
System.String | proxyIconUrl | The proxied icon url of the author. Default is null. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithColor(Color)
Sets the Color of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | The embed color. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithDescription(String)
Sets the Description of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithDescription(string description)
Parameters
Type | Name | Description |
---|---|---|
System.String | description | The embed description. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithField(DiscordEmbedField)
Adds a DiscordEmbedField to the Fields of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithField(DiscordEmbedField field)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedField | field | The new field. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithField(String, String, Nullable<Boolean>)
Adds a DiscordEmbedField to the Fields of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithField(string name, string value, bool? isInline = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field. |
System.String | value | The value of the field. |
System.Nullable<System.Boolean> | isInline | Whether or not the field is inline. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithFields(IEnumerable<DiscordEmbedField>)
Adds DiscordEmbedFields to the Fields of the DiscordEmbed .
Declaration
public DiscordEmbedBuilder WithFields(IEnumerable<DiscordEmbedField> fields)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<DiscordEmbedField> | fields | The new fields. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithFooter(DiscordEmbedFooter)
Sets the Footer of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithFooter(DiscordEmbedFooter footer)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedFooter | footer | The footer of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithFooter(String, String, String)
Sets the Footer of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithFooter(string text, string iconUrl = null, string proxyIconUrl = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text of the footer |
System.String | iconUrl | The icon url of the footer. |
System.String | proxyIconUrl | The proxy icon url of the footer. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithImage(DiscordEmbedImage)
Sets the Image of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithImage(DiscordEmbedImage image)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedImage | image | The image of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithImage(String, String, Nullable<Int32>, Nullable<Int32>)
Sets the Image of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithImage(string imageUrl, string imageProxyUrl = null, int? width = null, int? height = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageUrl | The image URL. |
System.String | imageProxyUrl | The proxy image URL. Default is null. |
System.Nullable<System.Int32> | width | The width of the image. Default is null. |
System.Nullable<System.Int32> | height | The height of the image. Default is null. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithProvider(DiscordEmbedProvider)
Sets the Provider of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithProvider(DiscordEmbedProvider provider)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedProvider | provider | The provider of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithProvider(String, String)
Sets the Provider of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithProvider(string name, string url = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The provider name. |
System.String | url | The provider url. Default is null. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithThumbnail(DiscordEmbedThumbnail)
Sets the Thumbnail of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithThumbnail(DiscordEmbedThumbnail thumbnail)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedThumbnail | thumbnail | The thumbnail of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithThumbnail(String, String, Nullable<Int32>, Nullable<Int32>)
Sets the Thumbnail of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithThumbnail(string imageUrl, string imageProxyUrl = null, int? width = null, int? height = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageUrl | The image URL. |
System.String | imageProxyUrl | The proxy image URL. Default is null. |
System.Nullable<System.Int32> | width | The width of the image. Default is null. |
System.Nullable<System.Int32> | height | The height of the image. Default is null. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithTimeStamp()
Sets the Url of the DiscordEmbed. With the current UTC time.
Declaration
public DiscordEmbedBuilder WithTimeStamp()
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithTimeStamp(DateTimeOffset)
Sets the Url of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithTimeStamp(DateTimeOffset timeStamp)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | timeStamp | The embed timestamp. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithTitle(String)
Sets the Title of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithTitle(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The embed title. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithType(DiscordEmbedType)
Sets the Type of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithType(DiscordEmbedType type)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedType | type | The embed type. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithUrl(String)
Sets the Url of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithUrl(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The embed url. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithVideo(DiscordEmbedVideo)
Sets the Video of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithVideo(DiscordEmbedVideo video)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbedVideo | video | The video of the embed. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |
WithVideo(String, String, Nullable<Int32>, Nullable<Int32>)
Sets the Video of the DiscordEmbed.
Declaration
public DiscordEmbedBuilder WithVideo(string imageUrl, string imageProxyUrl = null, int? width = null, int? height = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageUrl | The image URL. |
System.String | imageProxyUrl | The proxy image URL. Default is null. |
System.Nullable<System.Int32> | width | The width of the image. Default is null. |
System.Nullable<System.Int32> | height | The height of the image. Default is null. |
Returns
Type | Description |
---|---|
DiscordEmbedBuilder | The updated DiscordEmbedBuilder. |