diff --git a/README.rst b/README.rst index f6514e9b..6c875a60 100644 --- a/README.rst +++ b/README.rst @@ -28,6 +28,7 @@ Custom Features - Added support for ``int()`` to ``discord.User``, ``discord.Member``, ``discord.Emoji``, ``discord.Role``, ``discord.Guild``, ``discord.Message``, ``discord.TextChannel``, ``discord.VoiceChannel``, ``discord.CategoryChannel``, ``discord.Attachment`` and ``discord.Message``. This will return their id - Added support for ``str()`` to ``discord.Message``. This will return the message content - Added ``Guild.try_member`` +- Added ``Context.clean_prefix`` Key Features ------------- diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 79766499..8d17bca6 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -87,7 +87,9 @@ class Context(discord.abc.Messageable): @property def clean_prefix(self): - """:class:`str`: The cleaned up invoke prefix. i.e. mentions are ``@name`` instead of ``<@id>``.""" + """:class:`str`: The cleaned up invoke prefix. i.e. mentions are ``@name`` instead of ``<@id>``. + + .. versionadded:: 1.5.1.4""" user = self.guild.me if self.guild else self.bot.user pattern = re.compile(r"<@!?%s>" % user.id) return pattern.sub("@%s" % user.display_name.replace('\\', r'\\'), self.prefix) diff --git a/docs/index.rst b/docs/index.rst index 95a34c09..761ec902 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,6 +33,7 @@ Custom Features - Added support for ``int()`` to ``discord.User``, ``discord.Member``, ``discord.Emoji``, ``discord.Role``, ``discord.Guild``, ``discord.Message``, ``discord.TextChannel``, ``discord.VoiceChannel``, ``discord.CategoryChannel``, ``discord.Attachment`` and ``discord.Message``. This will return their id - Added support for ``str()`` to ``discord.Message``. This will return the message content - Added ``Guild.try_member`` +- Added ``Context.clean_prefix`` Features --------