Embeds

discord_http.embeds module

class discord_http.embeds.Embed(*, title=None, description=None, colour=None, color=None, url=None, timestamp=None)

Bases: object

Parameters:
add_field(*, name, value, inline=True) Self

Add a field to the embed.

Parameters:
  • name (str) – Title of the field

  • value (str) – Description of the field

  • inline (bool) – Whether the field is inline or not

Return type:

Self

Returns:

Returns the embed you are editing

copy() Self

Returns a copy of the embed.

Return type:

Self

classmethod from_dict(data) Self

Create an embed from a dictionary.

Parameters:

data (dict) – The dictionary to create the embed from

Return type:

Self

Returns:

The embed created from the dictionary

remove_author() Self

Remove the author from the embed.

Return type:

Self

Returns:

Returns the embed you are editing

remove_field(index) Self

Remove a field from the embed.

Parameters:

index (int) – The index of the field to remove

Return type:

Self

Returns:

Returns the embed you are editing

Remove the footer from the embed.

Return type:

Self

Returns:

Returns the embed you are editing

remove_image() Self

Remove the image from the embed.

Return type:

Self

Returns:

Returns the embed you are editing

remove_thumbnail() Self

Remove the thumbnail from the embed.

Return type:

Self

Returns:

Returns the embed you are editing

set_author(*, name, url=None, icon_url=None) Self

Set the author of the embed.

Parameters:
  • name (str) – The name of the author

  • url (str | None) – The URL which the author name will link to

  • icon_url (Asset | str | None) – The icon URL of the author

Return type:

Self

Returns:

Returns the embed you are editing

set_colour(value) Self

Set the colour of the embed.

Parameters:

value (Colour | int | None) – The colour to set the embed to. If None, the colour will be removed

Return type:

Self

Returns:

Returns the embed you are editing

Set the footer of the embed.

Parameters:
  • text (str | None) – The text of the footer

  • icon_url (Asset | str | None) – Icon URL of the footer

Return type:

Self

Returns:

Returns the embed you are editing

set_image(*, url=None) Self

Set the image of the embed.

Parameters:

url (Asset | str | None) – The URL of the image

Return type:

Self

Returns:

Returns the embed you are editing

set_thumbnail(*, url=None) Self

Set the thumbnail of the embed.

Parameters:

url (Asset | str | None) – The URL of the thumbnail

Return type:

Self

Returns:

Returns the embed you are editing

to_dict() dict

The embed as a dictionary.

Return type:

dict