diff --git a/info/info.py b/info/info.py index ab5faf4..97c7678 100644 --- a/info/info.py +++ b/info/info.py @@ -13,7 +13,8 @@ from redbot.core.utils.chat_formatting import ( humanize_timedelta, ) from redbot.core.utils.common_filters import ( - filter_invites + filter_invites, + escape_spoilers_and_mass_mentions ) @@ -346,6 +347,15 @@ class Info(commands.Cog): string += f"{status_string}\n" return string + async def get_names_and_nicks(self, user): + names = await self.config.user(user).past_names() + nicks = await self.config.member(user).past_nicks() + if names: + names = [escape_spoilers_and_mass_mentions(name) for name in names if name] + if nicks: + nicks = [escape_spoilers_and_mass_mentions(nick) for nick in nicks if nick] + return names, nicks + @commands.command() @commands.guild_only() @commands.bot_has_permissions(embed_links=True)