Skip to content

Commit

Permalink
fix!: fix json serialization (#588)
Browse files Browse the repository at this point in the history
* fix!: fix EmbedImageStruct serialization

* fix!: Button emoji serialization
  • Loading branch information
EdVraz committed Feb 28, 2022
1 parent d692810 commit f992dd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions interactions/api/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,3 +901,12 @@ def __init__(self, **kwargs):

if self.footer:
self._json.update({"footer": self.footer._json})

if self.video:
self._json.update({"video": self.video._json})

if self.image:
self._json.update({"image": self.image._json})

if self.thumbnail:
self._json.update({"thumbnail": self.thumbnail._json})
2 changes: 2 additions & 0 deletions interactions/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def __init__(self, **kwargs) -> None:
self.type = ComponentType.BUTTON
self.style = ButtonStyle(self.style)
self._json.update({"type": self.type.value, "style": self.style.value})
if self.emoji:
self._json.update({"emoji": self.emoji._json})


class Component(DictSerializerMixin):
Expand Down

0 comments on commit f992dd2

Please sign in to comment.