Skip to content

Commit d396faf

Browse files
committed
Fix typing issues
1 parent 823dea8 commit d396faf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

discord/channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
from .sticker import GuildSticker, StickerItem
104104
from .file import File
105105
from .user import BaseUser, ClientUser, User
106-
from .guild import Guild, GuildChannel as GuildChannelType
106+
from .guild import Guild, GuildChannel as GuildChannelType, UserGuild
107107
from .settings import ChannelSettings
108108
from .read_state import ReadState
109109
from .types.channel import (
@@ -4653,7 +4653,7 @@ async def _get_channel(self) -> PartialMessageable:
46534653
return self
46544654

46554655
@classmethod
4656-
def _from_webhook_channel(cls, guild: Guild, channel: WebhookChannelPayload) -> Self:
4656+
def _from_webhook_channel(cls, guild: Union[Guild, UserGuild], channel: WebhookChannelPayload) -> Self:
46574657
return cls(
46584658
state=guild._state,
46594659
id=int(channel['id']),

discord/message.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,11 @@ async def to_file(
446446
def to_dict(self) -> AttachmentPayload:
447447
result: AttachmentPayload = {
448448
'filename': self.filename,
449+
'flags': self._flags,
449450
'id': self.id,
450451
'proxy_url': self.proxy_url,
451452
'size': self.size,
452453
'url': self.url,
453-
'spoiler': self.is_spoiler(),
454454
}
455455
if self.height:
456456
result['height'] = self.height
@@ -460,6 +460,8 @@ def to_dict(self) -> AttachmentPayload:
460460
result['content_type'] = self.content_type
461461
if self.description is not None:
462462
result['description'] = self.description
463+
if self.title is not None:
464+
result['title'] = self.title
463465
return result
464466

465467

0 commit comments

Comments
 (0)