Skip to content

Commit

Permalink
fix reference kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
NeloBlivion authored Feb 5, 2025
1 parent 63f1675 commit 389ffa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,10 +1588,11 @@ async def send(
_reference = None
if reference is not None:
try:
_reference = reference.to_message_reference_dict()
from .message import MessageReference

if not isinstance(reference, MessageReference):
if isinstance(reference, MessageReference):
_reference = reference
else:
_reference = reference.to_message_reference_dict()
utils.warn_deprecated(
f"Passing {type(reference).__name__} to reference",
"MessageReference",
Expand Down
6 changes: 3 additions & 3 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,12 @@ def __init__(
id=reference.channel_id,
)
)
self.original_message = state._get_message(self.id) or (
self.id and channel.get_partial_message(self.id)
)
self.guild = state._get_guild(reference.guild_id) or (
reference.guild_id and Object(reference.guild_id)
)
self.original_message = state._get_message(self.id) or (
self.id and self.channel.get_partial_message(self.id)
)
self.content: str = data["content"]
self.embeds: list[Embed] = [Embed.from_dict(a) for a in data["embeds"]]
self.attachments: list[Attachment] = [
Expand Down

0 comments on commit 389ffa7

Please sign in to comment.