Skip to content

Commit

Permalink
fix: account for BaseChannel for channel mentions (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstreaTSS authored Jul 15, 2023
1 parent d7bcfba commit cea4f78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interactions/models/discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from interactions.client.utils.attr_converters import timestamp_converter
from interactions.client.utils.serializer import dict_filter_none
from interactions.client.utils.text_utils import mentions
from interactions.models.discord.channel import BaseChannel
from interactions.models.discord.channel import BaseChannel, GuildChannel
from interactions.models.discord.emoji import process_emoji_req_format
from interactions.models.discord.file import UPLOADABLE_TYPE
from interactions.models.discord.embed import process_embeds
Expand Down Expand Up @@ -109,7 +109,7 @@ def _process_dict(cls, data: Dict[str, Any], _) -> Dict[str, Any]:

@attrs.define(eq=False, order=False, hash=False, kw_only=True)
class ChannelMention(DiscordObject):
guild_id: "Snowflake_Type" = attrs.field(
guild_id: "Snowflake_Type | None" = attrs.field(
repr=False,
)
"""id of the guild containing the channel"""
Expand Down Expand Up @@ -466,7 +466,7 @@ def _process_dict(cls, data: dict, client: "Client") -> dict: # noqa: C901
if channel_id not in found_ids and (channel := client.get_channel(channel_id)):
channel_data = {
"id": channel.id,
"guild_id": channel._guild_id,
"guild_id": channel._guild_id if isinstance(channel, GuildChannel) else None,
"type": channel.type,
"name": channel.name,
}
Expand Down

0 comments on commit cea4f78

Please sign in to comment.