@@ -1497,9 +1497,9 @@ async def send(
1497
1497
.. versionadded:: 1.4
1498
1498
1499
1499
reference: Union[:class:`~discord.Message`, :class:`~discord.MessageReference`, :class:`~discord.PartialMessage`]
1500
- A reference to the :class:`~discord.Message` to which you are replying, this can be created using
1501
- :meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`. You can control
1502
- whether this mentions the author of the referenced message using the
1500
+ A reference to the :class:`~discord.Message` being replied to or forwarded. This can be created using
1501
+ :meth:`~discord.Message.to_reference`.
1502
+ When replying, you can control whether this mentions the author of the referenced message using the
1503
1503
:attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions`` or by
1504
1504
setting ``mention_author``.
1505
1505
@@ -1589,9 +1589,19 @@ async def send(
1589
1589
allowed_mentions = allowed_mentions or AllowedMentions ().to_dict ()
1590
1590
allowed_mentions ["replied_user" ] = bool (mention_author )
1591
1591
1592
+ _reference = None
1592
1593
if reference is not None :
1593
1594
try :
1594
- reference = reference .to_message_reference_dict ()
1595
+ _reference = reference .to_message_reference_dict ()
1596
+ from .message import MessageReference
1597
+
1598
+ if not isinstance (reference , MessageReference ):
1599
+ utils .warn_deprecated (
1600
+ f"Passing { type (reference ).__name__ } to reference" ,
1601
+ "MessageReference" ,
1602
+ "2.7" ,
1603
+ "3.0" ,
1604
+ )
1595
1605
except AttributeError :
1596
1606
raise InvalidArgument (
1597
1607
"reference parameter must be Message, MessageReference, or"
@@ -1641,7 +1651,7 @@ async def send(
1641
1651
nonce = nonce ,
1642
1652
enforce_nonce = enforce_nonce ,
1643
1653
allowed_mentions = allowed_mentions ,
1644
- message_reference = reference ,
1654
+ message_reference = _reference ,
1645
1655
stickers = stickers ,
1646
1656
components = components ,
1647
1657
flags = flags .value ,
@@ -1660,7 +1670,7 @@ async def send(
1660
1670
nonce = nonce ,
1661
1671
enforce_nonce = enforce_nonce ,
1662
1672
allowed_mentions = allowed_mentions ,
1663
- message_reference = reference ,
1673
+ message_reference = _reference ,
1664
1674
stickers = stickers ,
1665
1675
components = components ,
1666
1676
flags = flags .value ,
0 commit comments