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 and dolfies committed Dec 4, 2024
1 parent 52edcfb commit 0d19544
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 @@ -4589,6 +4589,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 0d19544

Please sign in to comment.