Skip to content

Commit

Permalink
Use iconUrl instead of icon_url for Embeds
Browse files Browse the repository at this point in the history
Per 91e91946
  • Loading branch information
shayypy committed Aug 25, 2021
1 parent 1b5aa1c commit 38fe803
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions guilded/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def set_footer(self, *, text=EmptyEmbed, icon_url=EmptyEmbed):
self._footer['text'] = str(text)

if icon_url is not EmptyEmbed:
self._footer['icon_url'] = str(icon_url)
self._footer['iconUrl'] = str(icon_url)

return self

Expand Down Expand Up @@ -447,7 +447,7 @@ def set_author(self, *, name, url=EmptyEmbed, icon_url=EmptyEmbed):
self._author['url'] = str(url)

if icon_url is not EmptyEmbed:
self._author['icon_url'] = str(icon_url)
self._author['iconUrl'] = str(icon_url)

return self

Expand Down Expand Up @@ -583,7 +583,15 @@ def set_field_at(self, index, *, name, value, inline=True):
return self

def to_dict(self):
"""Converts this embed object into a dict."""
"""Converts this embed object into a dict.
.. note::
The resulting dict will be more or less identical to Discord's
format for embeds, with the exception that an ``iconUrl`` key is
used in place of ``icon_url``s. This is because ``icon_url``s do
not display on Desktop clients.
"""

# add in the raw data into the dict
result = {
Expand Down

1 comment on commit 38fe803

@shayypy
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I meant to link - GuildedAPI/docs@91e9194

Please sign in to comment.