diff options
| author | pikaninja <[email protected]> | 2021-03-24 20:13:57 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-24 23:13:57 -0400 |
| commit | 5a93e80e87051a5a46a8928e898feff62d2167b7 (patch) | |
| tree | 595bac13563252c63be440f2398ff3d99be8940c | |
| parent | Recreate aiohttp.FormData objects during request retries (diff) | |
| download | discord.py-5a93e80e87051a5a46a8928e898feff62d2167b7.tar.xz discord.py-5a93e80e87051a5a46a8928e898feff62d2167b7.zip | |
Implicitly cast Embed construction parameters to str
| -rw-r--r-- | discord/embeds.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/discord/embeds.py b/discord/embeds.py index e93e16f2..95470e18 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -116,6 +116,15 @@ class Embed: self.url = kwargs.get('url', EmptyEmbed) self.description = kwargs.get('description', EmptyEmbed) + if self.title is not EmptyEmbed: + self.title = str(self.title) + + if self.description is not EmptyEmbed: + self.description = str(self.description) + + if self.url is not EmptyEmbed: + self.url = str(self.url) + try: timestamp = kwargs['timestamp'] except KeyError: @@ -149,6 +158,15 @@ class Embed: self.description = data.get('description', EmptyEmbed) self.url = data.get('url', EmptyEmbed) + if self.title is not EmptyEmbed: + self.title = str(self.title) + + if self.description is not EmptyEmbed: + self.description = str(self.description) + + if self.url is not EmptyEmbed: + self.url = str(self.url) + # try to fill in the more rich fields try: |