Add support for voice channel parties #33

Closed
wasi-master wants to merge 277 commits from master into 2.0
111 changed files with 10075 additions and 5631 deletions
Showing only changes of commit f4bec507c1 - Show all commits

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

View File

@ -98,6 +98,11 @@ class CogMeta(type):
attrs['__cog_name__'] = kwargs.pop('name', name)
attrs['__cog_settings__'] = command_attrs = kwargs.pop('command_attrs', {})
aliases = kwargs.pop('aliases', [])
if not isinstance(aliases, list):
raise TypeError("Cog aliases must be a list, not a {0}".format(type(aliases)))
attrs['aliases'] = aliases
description = kwargs.pop('description', None)
if description is None:
description = inspect.cleandoc(attrs.get('__doc__', ''))