Add mention property to PartialMessageable

This commit is contained in:
Soheab 2024-12-01 22:10:19 +01:00 committed by GitHub
parent e1b6310ef3
commit 7f95357041
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3529,6 +3529,14 @@ class PartialMessageable(discord.abc.Messageable, Hashable):
return Permissions.none()
@property
def mention(self) -> str:
""":class:`str`: Returns a string that allows you to mention the channel.
.. versionadded:: 2.5
"""
return f'<#{self.id}>'
def get_partial_message(self, message_id: int, /) -> PartialMessage:
"""Creates a :class:`PartialMessage` from the message ID.