@@ -1497,9 +1497,9 @@ async def send(
14971497 .. versionadded:: 1.4
14981498
14991499 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
15031503 :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions`` or by
15041504 setting ``mention_author``.
15051505
@@ -1589,9 +1589,19 @@ async def send(
15891589 allowed_mentions = allowed_mentions or AllowedMentions ().to_dict ()
15901590 allowed_mentions ["replied_user" ] = bool (mention_author )
15911591
1592+ _reference = None
15921593 if reference is not None :
15931594 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+ )
15951605 except AttributeError :
15961606 raise InvalidArgument (
15971607 "reference parameter must be Message, MessageReference, or"
@@ -1641,7 +1651,7 @@ async def send(
16411651 nonce = nonce ,
16421652 enforce_nonce = enforce_nonce ,
16431653 allowed_mentions = allowed_mentions ,
1644- message_reference = reference ,
1654+ message_reference = _reference ,
16451655 stickers = stickers ,
16461656 components = components ,
16471657 flags = flags .value ,
@@ -1660,7 +1670,7 @@ async def send(
16601670 nonce = nonce ,
16611671 enforce_nonce = enforce_nonce ,
16621672 allowed_mentions = allowed_mentions ,
1663- message_reference = reference ,
1673+ message_reference = _reference ,
16641674 stickers = stickers ,
16651675 components = components ,
16661676 flags = flags .value ,
0 commit comments