Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: fix wrong channel id in guild.create_thread, re-apply fixes for embed image serialisation #618

Merged
merged 9 commits into from Mar 7, 2022
4 changes: 2 additions & 2 deletions interactions/api/models/guild.py
Expand Up @@ -654,8 +654,8 @@ async def create_thread(
_invitable = None if invitable is MISSING else invitable
_message_id = None if message_id is MISSING else message_id
res = await self._client.create_thread(
channel_id=int(self.id),
thread_type=type.value,
channel_id=channel_id,
thread_type=type.value if not isinstance(type, int) else type,
name=name,
auto_archive_duration=_auto_archive_duration,
invitable=_invitable,
Expand Down
9 changes: 9 additions & 0 deletions interactions/api/models/message.py
Expand Up @@ -902,6 +902,15 @@ def __init__(self, **kwargs):
if self.footer:
self._json.update({"footer": self.footer._json})

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

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

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

def add_field(self, name: str, value: str, inline: Optional[bool] = False) -> None:
"""
Adds a field to the embed
Expand Down