Search Results for

    Show / Hide Table of Contents

    Class DiscordEmbedBuilder

    Constructs embeds.

    Inheritance
    System.Object
    DiscordEmbedBuilder
    Namespace: DisCatSharp.Entities
    Assembly: DisCatSharp.dll
    Syntax
    public sealed class DiscordEmbedBuilder

    Constructors

    | Improve this Doc View Source

    DiscordEmbedBuilder()

    Constructs a new empty embed builder.

    Declaration
    public DiscordEmbedBuilder()
    | Improve this Doc View Source

    DiscordEmbedBuilder(DiscordEmbed)

    Constructs a new embed builder using another embed as prototype.

    Declaration
    public DiscordEmbedBuilder(DiscordEmbed original)
    Parameters
    Type Name Description
    DiscordEmbed original

    Embed to use as prototype.

    Properties

    | Improve this Doc View Source

    Author

    Gets or sets the embed's author.

    Declaration
    public DiscordEmbedBuilder.EmbedAuthor Author { get; set; }
    Property Value
    Type Description
    DiscordEmbedBuilder.EmbedAuthor
    | Improve this Doc View Source

    Color

    Gets or sets the embed's color.

    Declaration
    public Optional<DiscordColor> Color { get; set; }
    Property Value
    Type Description
    Optional<DiscordColor>
    | Improve this Doc View Source

    Description

    Gets or sets the embed's description.

    Declaration
    public string Description { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Fields

    Gets the embed's fields.

    Declaration
    public IReadOnlyList<DiscordEmbedField> Fields { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<DiscordEmbedField>
    | Improve this Doc View Source

    Footer

    Gets or sets the embed's footer.

    Declaration
    public DiscordEmbedBuilder.EmbedFooter Footer { get; set; }
    Property Value
    Type Description
    DiscordEmbedBuilder.EmbedFooter
    | Improve this Doc View Source

    ImageUrl

    Gets or sets the embed's image url.

    Declaration
    public string ImageUrl { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Thumbnail

    Gets or sets the embed's thumbnail.

    Declaration
    public DiscordEmbedBuilder.EmbedThumbnail Thumbnail { get; set; }
    Property Value
    Type Description
    DiscordEmbedBuilder.EmbedThumbnail
    | Improve this Doc View Source

    Timestamp

    Gets or sets the embed's timestamp.

    Declaration
    public DateTimeOffset? Timestamp { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTimeOffset>
    | Improve this Doc View Source

    Title

    Gets or sets the embed's title.

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Url

    Gets or sets the url for the embed's title.

    Declaration
    public string Url { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AddField(DiscordEmbedField)

    Adds a field to this embed.

    Declaration
    public DiscordEmbedBuilder AddField(DiscordEmbedField field)
    Parameters
    Type Name Description
    DiscordEmbedField field

    The field to add.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    AddField(String, String, Boolean)

    Adds a field to this embed.

    Declaration
    [Obsolete("DiscordEmbedFields should be constructed manually.")]
    public DiscordEmbedBuilder AddField(string name, string value, bool inline = false)
    Parameters
    Type Name Description
    System.String name

    Name of the field to add.

    System.String value

    Value of the field to add.

    System.Boolean inline

    Whether the field is to be inline or not.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    AddFields(DiscordEmbedField[])

    Adds multiple fields to this embed.

    Declaration
    public DiscordEmbedBuilder AddFields(params DiscordEmbedField[] fields)
    Parameters
    Type Name Description
    DiscordEmbedField[] fields

    The fields to add.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    AddFields(IEnumerable<DiscordEmbedField>)

    Adds multiple fields to this embed.

    Declaration
    public DiscordEmbedBuilder AddFields(IEnumerable<DiscordEmbedField> fields)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<DiscordEmbedField> fields

    The fields to add.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    Build()

    Constructs a new embed from data supplied to this builder.

    Declaration
    public DiscordEmbed Build()
    Returns
    Type Description
    DiscordEmbed

    New discord embed.

    | Improve this Doc View Source

    ClearFields()

    Removes all fields from this embed.

    Declaration
    public DiscordEmbedBuilder ClearFields()
    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    RemoveField(DiscordEmbedField)

    Removes a field from this embed, if it is part of it.

    Declaration
    public DiscordEmbedBuilder RemoveField(DiscordEmbedField field)
    Parameters
    Type Name Description
    DiscordEmbedField field

    The field to remove.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    RemoveFieldAt(Int32)

    Removes a field of the specified index from this embed.

    Declaration
    public DiscordEmbedBuilder RemoveFieldAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Index of the field to remove.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    RemoveFieldRange(Int32, Int32)

    Removes fields of the specified range from this embed.

    Declaration
    public DiscordEmbedBuilder RemoveFieldRange(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index

    Index of the first field to remove.

    System.Int32 count

    Number of fields to remove.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    RemoveFields(DiscordEmbedField[])

    Removes multiple fields from this embed, if they are part of it.

    Declaration
    public DiscordEmbedBuilder RemoveFields(params DiscordEmbedField[] fields)
    Parameters
    Type Name Description
    DiscordEmbedField[] fields

    The fields to remove.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    RemoveFields(IEnumerable<DiscordEmbedField>)

    Removes multiple fields from this embed, if they are part of it.

    Declaration
    public DiscordEmbed RemoveFields(IEnumerable<DiscordEmbedField> fields)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<DiscordEmbedField> fields

    The fields to remove.

    Returns
    Type Description
    DiscordEmbed

    This embed builder.

    | Improve this Doc View Source

    WithAuthor(String, String, String)

    Sets the embed's author.

    Declaration
    public DiscordEmbedBuilder WithAuthor(string name = null, string url = null, string iconUrl = null)
    Parameters
    Type Name Description
    System.String name

    Author's name.

    System.String url

    Author's url.

    System.String iconUrl

    Author icon's url.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithColor(DiscordColor)

    Sets the embed's color.

    Declaration
    public DiscordEmbedBuilder WithColor(DiscordColor color)
    Parameters
    Type Name Description
    DiscordColor color

    Embed color to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithDescription(String)

    Sets the embed's description.

    Declaration
    public DiscordEmbedBuilder WithDescription(string description)
    Parameters
    Type Name Description
    System.String description

    Description to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithFooter(String, String)

    Sets the embed's footer.

    Declaration
    public DiscordEmbedBuilder WithFooter(string text = null, string iconUrl = null)
    Parameters
    Type Name Description
    System.String text

    Footer's text.

    System.String iconUrl

    Footer icon's url.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithImageUrl(String)

    Sets the embed's image url.

    Declaration
    public DiscordEmbedBuilder WithImageUrl(string url)
    Parameters
    Type Name Description
    System.String url

    Image url to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithImageUrl(Uri)

    Sets the embed's image url.

    Declaration
    public DiscordEmbedBuilder WithImageUrl(Uri url)
    Parameters
    Type Name Description
    System.Uri url

    Image url to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithThumbnail(String, Int32, Int32)

    Sets the embed's thumbnail.

    Declaration
    public DiscordEmbedBuilder WithThumbnail(string url, int height = 0, int width = 0)
    Parameters
    Type Name Description
    System.String url

    Thumbnail url to set.

    System.Int32 height

    The height of the thumbnail to set.

    System.Int32 width

    The width of the thumbnail to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithThumbnail(Uri, Int32, Int32)

    Sets the embed's thumbnail.

    Declaration
    public DiscordEmbedBuilder WithThumbnail(Uri url, int height = 0, int width = 0)
    Parameters
    Type Name Description
    System.Uri url

    Thumbnail url to set.

    System.Int32 height

    The height of the thumbnail to set.

    System.Int32 width

    The width of the thumbnail to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithTimestamp(Nullable<DateTime>)

    Sets the embed's timestamp.

    Declaration
    public DiscordEmbedBuilder WithTimestamp(DateTime? timestamp)
    Parameters
    Type Name Description
    System.Nullable<System.DateTime> timestamp

    Timestamp to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithTimestamp(Nullable<DateTimeOffset>)

    Sets the embed's timestamp.

    Declaration
    public DiscordEmbedBuilder WithTimestamp(DateTimeOffset? timestamp)
    Parameters
    Type Name Description
    System.Nullable<System.DateTimeOffset> timestamp

    Timestamp to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithTimestamp(UInt64)

    Sets the embed's timestamp based on a snowflake.

    Declaration
    public DiscordEmbedBuilder WithTimestamp(ulong snowflake)
    Parameters
    Type Name Description
    System.UInt64 snowflake

    Snowflake to calculate timestamp from.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithTitle(String)

    Sets the embed's title.

    Declaration
    public DiscordEmbedBuilder WithTitle(string title)
    Parameters
    Type Name Description
    System.String title

    Title to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithUrl(String)

    Sets the embed's title url.

    Declaration
    public DiscordEmbedBuilder WithUrl(string url)
    Parameters
    Type Name Description
    System.String url

    Title url to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    | Improve this Doc View Source

    WithUrl(Uri)

    Sets the embed's title url.

    Declaration
    public DiscordEmbedBuilder WithUrl(Uri url)
    Parameters
    Type Name Description
    System.Uri url

    Title url to set.

    Returns
    Type Description
    DiscordEmbedBuilder

    This embed builder.

    Operators

    | Improve this Doc View Source

    Implicit(DiscordEmbedBuilder to DiscordEmbed)

    Implicitly converts this builder to an embed.

    Declaration
    public static implicit operator DiscordEmbed(DiscordEmbedBuilder builder)
    Parameters
    Type Name Description
    DiscordEmbedBuilder builder

    Builder to convert.

    Returns
    Type Description
    DiscordEmbed

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems