Browse Source

add `mention` property to `SoundBoard`

pull/10081/head
owocado 3 months ago
committed by GitHub
parent
commit
4ba8110675
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 16
      discord/soundboard.py

16
discord/soundboard.py

@ -148,6 +148,14 @@ class SoundboardDefaultSound(BaseSoundboardSound):
inner = ' '.join('%s=%r' % t for t in attrs)
return f"<{self.__class__.__name__} {inner}>"
@property
def mention(self) -> str:
""":class:`str`: Returns a string that allows you to mention this default sound.
.. versionadded:: 2.5
"""
return f'<sound:0:{self.id}>'
class SoundboardSound(BaseSoundboardSound):
"""Represents a Discord soundboard sound.
@ -232,6 +240,14 @@ class SoundboardSound(BaseSoundboardSound):
return self._state.get_user(self._user_id)
return User(state=self._state, data=self._user)
@property
def mention(self) -> str:
""":class:`str`: Returns a string that allows you to mention this sound.
.. versionadded:: 2.5
"""
return f'<sound:{self.guild.id}:{self.id}>'
async def edit(
self,
*,

Loading…
Cancel
Save