diff options
author | 2019-09-17 05:05:52 +1000 | |
---|---|---|
committer | 2019-09-17 05:05:52 +1000 | |
commit | 230bd00695ac6be5b0dd0907ead776d48e153da2 (patch) | |
tree | 358703e95093e7f83aca33b529c54abbfd6a22a3 | |
parent | Update discord.py version to 1.2.3 (diff) |
Adjust to new cog method names.
-rw-r--r-- | bot/cogs/moderation.py | 6 | ||||
-rw-r--r-- | bot/cogs/off_topic_names.py | 2 | ||||
-rw-r--r-- | bot/cogs/verification.py | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py index fcbadd235..c631dd69d 100644 --- a/bot/cogs/moderation.py +++ b/bot/cogs/moderation.py @@ -1375,13 +1375,15 @@ class Moderation(Scheduler, Cog): # endregion - async def __error(self, ctx: Context, error) -> None: + @staticmethod + async def cog_command_error(ctx: Context, error) -> None: if isinstance(error, BadUnionArgument): if User in error.converters: await ctx.send(str(error.errors[0])) error.handled = True - async def respect_role_hierarchy(self, ctx: Context, target: UserTypes, infr_type: str) -> bool: + @staticmethod + async def respect_role_hierarchy(ctx: Context, target: UserTypes, infr_type: str) -> bool: """ Check if the highest role of the invoking member is greater than that of the target member. If this check fails, a warning is sent to the invoking ctx. diff --git a/bot/cogs/off_topic_names.py b/bot/cogs/off_topic_names.py index f05ac7fef..cadc1bf92 100644 --- a/bot/cogs/off_topic_names.py +++ b/bot/cogs/off_topic_names.py @@ -76,7 +76,7 @@ class OffTopicNames(Cog): self.bot = bot self.updater_task = None - def __cleanup(self): + def cog_unload(self): if self.updater_task is not None: self.updater_task.cancel() diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py index 14c3f39e3..c42d4d67e 100644 --- a/bot/cogs/verification.py +++ b/bot/cogs/verification.py @@ -153,13 +153,13 @@ class Verification(Cog): ) @staticmethod - async def __error(ctx: Context, error): + async def cog_command_error(ctx: Context, error): if isinstance(error, InChannelCheckFailure): # Do nothing; just ignore this error error.handled = True @staticmethod - def __global_check(ctx: Context): + def bot_check(ctx: Context): """ Block any command within the verification channel that is not !accept. """ |