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: account for BaseChannel for channel mentions #1480

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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