mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Implicitly cast Embed construction parameters to str
This commit is contained in:
parent
1c8d1b0289
commit
5a93e80e87
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user