Skip to content

Commit

Permalink
Add mention property to PartialMessageable
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab authored Dec 1, 2024
1 parent e1b6310 commit 7f95357
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3529,6 +3529,14 @@ def permissions_for(self, obj: Any = None, /) -> Permissions:

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.
Expand Down

0 comments on commit 7f95357

Please sign in to comment.