Embeds¶
discord_http.embeds module¶
- class discord_http.embeds.Embed(*, title: str | None = None, description: str | None = None, colour: Colour | int | None = None, color: Colour | int | None = None, url: str | None = None, timestamp: datetime | None = None)[source]¶
Bases:
object
- add_field(*, name: str, value: str, inline: bool = True) Self [source]¶
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
- Returns:
Returns the embed you are editing
- Return type:
Embed
- classmethod from_dict(data: dict) Self [source]¶
Create an embed from a dictionary
- Parameters:
data (dict) – The dictionary to create the embed from
- Returns:
The embed created from the dictionary
- Return type:
Embed
- remove_author() Self [source]¶
Remove the author from the embed
- Returns:
Returns the embed you are editing
- Return type:
Embed
- remove_field(index: int) Self [source]¶
Remove a field from the embed
- Parameters:
index (int) – The index of the field to remove
- Returns:
Returns the embed you are editing
- Return type:
Embed
Remove the footer from the embed
- Returns:
Returns the embed you are editing
- Return type:
Embed
- remove_image() Self [source]¶
Remove the image from the embed
- Returns:
Returns the embed you are editing
- Return type:
Embed
- remove_thumbnail() Self [source]¶
Remove the thumbnail from the embed
- Returns:
Returns the embed you are editing
- Return type:
Embed
- set_author(*, name: str, url: str | None = None, icon_url: Asset | str | None = None) Self [source]¶
Set the author of the embed
- Parameters:
name (str) – The name of the author
url (Optional[str]) – The URL which the author name will link to
icon_url (Optional[Union[Asset, str]]) – The icon URL of the author
- Returns:
Returns the embed you are editing
- Return type:
Embed
- set_colour(value: Colour | int | None) Self [source]¶
Set the colour of the embed
- Parameters:
value (Optional[Union[Colour, int]]) – The colour to set the embed to. If None, the colour will be removed
- Returns:
Returns the embed you are editing
- Return type:
Self
Set the footer of the embed
- Parameters:
text (Optional[str]) – The text of the footer
icon_url (Optional[str]) – Icon URL of the footer
- Returns:
Returns the embed you are editing
- Return type:
Embed
- set_image(*, url: Asset | str | None = None) Self [source]¶
Set the image of the embed
- Parameters:
url (Optional[Union[Asset, str]]) – The URL of the image
- Returns:
Returns the embed you are editing
- Return type:
Embed