From 4ba8110675d002e7f7633d11a33f7664aafb9f22 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Sat, 18 Jan 2025 23:21:08 +0530 Subject: [PATCH] add `mention` property to `SoundBoard` --- discord/soundboard.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/discord/soundboard.py b/discord/soundboard.py index 3351aacb7..4fe2eb94d 100644 --- a/discord/soundboard.py +++ b/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, *,