Skip to content

Commit 342b591

Browse files
committed
Return new emote syntax
1 parent 6333fce commit 342b591

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

guilded/emote.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ class Emote(Hashable, AssetMixin):
9191
9292
Returns the name of the emote.
9393
94+
.. versionchanged:: 1.13
95+
If the :ref:`official markdown feature<clientfeatures>` is enabled,
96+
returns a markdown string for mentioning the emote instead.
97+
9498
Attributes
9599
-----------
96100
id: :class:`int`
@@ -141,7 +145,11 @@ def __init__(self, *, state, data: EmotePayload, **extra):
141145
self._underlying: Asset = asset
142146

143147
def __str__(self):
144-
return self.name
148+
return (
149+
f'<:{self.name}:{self.id}>'
150+
if self._state.client_features and self._state.client_features.official_markdown
151+
else self.name
152+
)
145153

146154
def __repr__(self):
147155
return f'<Emote id={self.id!r} name={self.name!r} server={self.server!r}>'

0 commit comments

Comments
 (0)