diff options
| author | 2019-09-14 01:09:53 +0800 | |
|---|---|---|
| committer | 2019-09-14 01:09:53 +0800 | |
| commit | e1dab123fc77986b09dc622457886635eb26d4ab (patch) | |
| tree | bf38f7863925b393326edf4dc04453508e545a2b /bot/seasons/evergreen/error_handler.py | |
| parent | Merge pull request #269 from python-discord/hacktoberfest-update (diff) | |
| parent | Fix incorrect merge conflict resolutions, lint remaining items (diff) | |
Merge pull request #270 from python-discord/flake8-annotations
Add Flake8 annotations
Diffstat (limited to 'bot/seasons/evergreen/error_handler.py')
| -rw-r--r-- | bot/seasons/evergreen/error_handler.py | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index 6690cf89..120462ee 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -4,7 +4,7 @@ import random  import sys
  import traceback
 -from discord import Colour, Embed
 +from discord import Colour, Embed, Message
  from discord.ext import commands
  from bot.constants import NEGATIVE_REPLIES
 @@ -16,11 +16,11 @@ log = logging.getLogger(__name__)  class CommandErrorHandler(commands.Cog):
      """A error handler for the PythonDiscord server."""
 -    def __init__(self, bot):
 +    def __init__(self, bot: commands.Bot):
          self.bot = bot
      @staticmethod
 -    def revert_cooldown_counter(command, message):
 +    def revert_cooldown_counter(command: commands.Command, message: Message) -> None:
          """Undoes the last cooldown counter for user-error cases."""
          if command._buckets.valid:
              bucket = command._buckets.get_bucket(message)
 @@ -30,7 +30,7 @@ class CommandErrorHandler(commands.Cog):              )
      @commands.Cog.listener()
 -    async def on_command_error(self, ctx, error):
 +    async def on_command_error(self, ctx: commands.Context, error: commands.CommandError) -> None:
          """Activates when a command opens an error."""
          if hasattr(ctx.command, 'on_error'):
              return logging.debug(
 @@ -113,7 +113,7 @@ class CommandErrorHandler(commands.Cog):          traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
 -def setup(bot):
 +def setup(bot: commands.Bot) -> None:
      """Error handler Cog load."""
      bot.add_cog(CommandErrorHandler(bot))
      log.info("CommandErrorHandler cog loaded")
  |