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.url = kwargs.get('url', EmptyEmbed)
|
||||||
self.description = kwargs.get('description', 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:
|
try:
|
||||||
timestamp = kwargs['timestamp']
|
timestamp = kwargs['timestamp']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -149,6 +158,15 @@ class Embed:
|
|||||||
self.description = data.get('description', EmptyEmbed)
|
self.description = data.get('description', EmptyEmbed)
|
||||||
self.url = data.get('url', 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 to fill in the more rich fields
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user