1919from .channel import Channel
2020from .emoji import Emoji
2121from .member import Member
22- from .misc import File , IDMixin , Snowflake
22+ from .misc import AllowedMentions , File , IDMixin , Snowflake
2323from .team import Application
2424from .user import User
2525
@@ -744,7 +744,6 @@ class Message(ClientSerializerMixin, IDMixin):
744744 :ivar Optional[MessageActivity] activity?: Message activity object that's sent by Rich Presence
745745 :ivar Optional[Application] application?: Application object that's sent by Rich Presence
746746 :ivar Optional[MessageReference] message_reference?: Data showing the source of a message (crosspost, channel follow, add, pin, or replied message)
747- :ivar Optional[Any] allowed_mentions: The allowed mentions of roles attached in the message.
748747 :ivar int flags: Message flags
749748 :ivar Optional[MessageInteraction] interaction?: Message interaction object, if the message is sent by an interaction.
750749 :ivar Optional[Channel] thread?: The thread that started from this message, if any, with a thread member object embedded.
@@ -846,7 +845,7 @@ async def edit(
846845 files : Optional [Union [File , List [File ]]] = MISSING ,
847846 embeds : Optional [Union ["Embed" , List ["Embed" ]]] = MISSING ,
848847 suppress_embeds : Optional [bool ] = MISSING ,
849- allowed_mentions : Optional ["MessageInteraction" ] = MISSING ,
848+ allowed_mentions : Optional [Union [ AllowedMentions , dict ] ] = MISSING ,
850849 message_reference : Optional [MessageReference ] = MISSING ,
851850 attachments : Optional [List ["Attachment" ]] = MISSING ,
852851 components : Optional [
@@ -873,8 +872,8 @@ async def edit(
873872 :type embeds?: Optional[Union[Embed, List[Embed]]]
874873 :param suppress_embeds?: Whether to suppress embeds in the message.
875874 :type suppress_embeds?: Optional[bool]
876- :param allowed_mentions?: The message interactions/mention limits that the message can refer to .
877- :type allowed_mentions?: Optional[MessageInteraction ]
875+ :param allowed_mentions?: The allowed mentions for the message.
876+ :type allowed_mentions?: Optional[Union[AllowedMentions, dict] ]
878877 :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first
879878 :type attachments?: Optional[List[Attachment]]
880879 :param components?: A component, or list of components for the message. If `[]` the components will be removed
@@ -922,7 +921,13 @@ async def edit(
922921 else []
923922 )
924923
925- _allowed_mentions : dict = {} if allowed_mentions is MISSING else allowed_mentions
924+ _allowed_mentions : dict = (
925+ {}
926+ if allowed_mentions is MISSING
927+ else allowed_mentions ._json
928+ if isinstance (allowed_mentions , AllowedMentions )
929+ else allowed_mentions
930+ )
926931 _message_reference : dict = {} if message_reference is MISSING else message_reference ._json
927932 if not components :
928933 _components = []
@@ -961,7 +966,7 @@ async def reply(
961966 embeds : Optional [Union ["Embed" , List ["Embed" ]]] = MISSING ,
962967 files : Optional [Union [File , List [File ]]] = MISSING ,
963968 attachments : Optional [List ["Attachment" ]] = MISSING ,
964- allowed_mentions : Optional ["MessageInteraction" ] = MISSING ,
969+ allowed_mentions : Optional [Union [ AllowedMentions , dict ] ] = MISSING ,
965970 stickers : Optional [List ["Sticker" ]] = MISSING ,
966971 components : Optional [
967972 Union [
@@ -987,8 +992,8 @@ async def reply(
987992 :type files?: Optional[Union[File, List[File]]]
988993 :param embeds?: An embed, or list of embeds for the message.
989994 :type embeds?: Optional[Union[Embed, List[Embed]]]
990- :param allowed_mentions?: The message interactions/mention limits that the message can refer to .
991- :type allowed_mentions?: Optional[MessageInteraction ]
995+ :param allowed_mentions?: The allowed mentions for the message.
996+ :type allowed_mentions?: Optional[Union[AllowedMentions, dict] ]
992997 :param components?: A component, or list of components for the message.
993998 :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]]
994999 :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message.
@@ -1009,7 +1014,13 @@ async def reply(
10091014 if not embeds or embeds is MISSING
10101015 else ([embed ._json for embed in embeds ] if isinstance (embeds , list ) else [embeds ._json ])
10111016 )
1012- _allowed_mentions : dict = {} if allowed_mentions is MISSING else allowed_mentions
1017+ _allowed_mentions : dict = (
1018+ {}
1019+ if allowed_mentions is MISSING
1020+ else allowed_mentions ._json
1021+ if isinstance (allowed_mentions , AllowedMentions )
1022+ else allowed_mentions
1023+ )
10131024 _message_reference = MessageReference (message_id = int (self .id ))._json
10141025 _attachments = [] if attachments is MISSING else [a ._json for a in attachments ]
10151026 if not components or components is MISSING :
0 commit comments