attempt at cog aliases

This commit is contained in:
iDutchy
2020-12-30 18:52:15 -06:00
parent 0354036451
commit f4bec507c1
2 changed files with 12 additions and 0 deletions

View File

@@ -529,6 +529,9 @@ class BotBase(GroupMixin):
cog = cog._inject(self)
self.__cogs[cog.__cog_name__] = cog
if cog.aliases:
for alias in cog.aliases:
self.__cogs[alias] = cog
def get_cog(self, name):
"""Gets the cog instance requested.
@@ -567,6 +570,10 @@ class BotBase(GroupMixin):
if cog is None:
return
if cog.aliases:
for alias in cog.aliases:
self.__cogs.pop(alias)
help_command = self._help_command
if help_command and help_command.cog is cog:
help_command.cog = None