Embeds#

Here’s everything you can do with embeds.

Example Code#

import datetime
import hikari

embed = hikari.Embed(
    title="embed's title",
    description=" embed's description",
    color=0xFFFFFF,  # you can use any hikari.Colourish object here.
    timestamp=datetime.datetime.now().astimezone(),  # any datetime object
)  # all the argumnts provided to this constructor are optional.

# adding an author
# the icon can be any hikari.Resourceish object which includes User avatars, local files, attachments, bytes, etc.
embed.set_author(
    name="embed author name",
    url="https://the-author-url.com",
    icon="https://linktoimage.url",
)

# adding a footer
# the icon can be any hikari.Resourceish object which includes User avatars, local files, attachments, bytes, etc.
embed.set_footer(
    "the footer text, this can be a positional or keyword arg",
    icon="https://linktoimage.url",
)

# images and thumbnails
embed.set_image("https://linktoimage.url")  # any hikari.Resourceish object
embed.set_thumbnail("https://linktoimage.url")  # any hikari.Resourceish object

# add fields
embed.add_field(
    name="field name", value="field value"
)  # name and value are required arguments.

embed.title = "embed's"
embed.description = "'s property can be edited"
embed.author = hikari.EmbedAuthor(name="this way too")
embed.colour = 0x000000  # color is an alias of colour.

Embed visualisation#