diff options
author | 2019-09-09 16:37:13 -0400 | |
---|---|---|
committer | 2019-09-09 16:37:13 -0400 | |
commit | 4b18d7e430d5cea16406c65349718f72919c01c3 (patch) | |
tree | 7fc4f6a0aea2d16e0409723d205c1ab45dcd920f /bot/utils | |
parent | Initial linting pass (diff) |
Lint remaining files
hacktoberstats cog handled in separate PR
Diffstat (limited to 'bot/utils')
-rw-r--r-- | bot/utils/__init__.py | 4 | ||||
-rw-r--r-- | bot/utils/halloween/spookifications.py | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/bot/utils/__init__.py b/bot/utils/__init__.py index 3249a9cf..8732eb22 100644 --- a/bot/utils/__init__.py +++ b/bot/utils/__init__.py @@ -29,7 +29,7 @@ async def disambiguate( choices = (f'{index}: {entry}' for index, entry in enumerate(entries, start=1)) - def check(message): + def check(message: discord.Message) -> bool: return (message.content.isdigit() and message.author == ctx.author and message.channel == ctx.channel) @@ -109,7 +109,7 @@ def replace_many( pattern = "|".join(re.escape(word) for word in words_to_replace) regex = re.compile(pattern, re.I if ignore_case else 0) - def _repl(match): + def _repl(match: re.Match) -> str: """Returns replacement depending on `ignore_case` and `match_case`""" word = match.group(0) replacement = replacements[word.lower() if ignore_case else word] diff --git a/bot/utils/halloween/spookifications.py b/bot/utils/halloween/spookifications.py index 69b49919..11f69850 100644 --- a/bot/utils/halloween/spookifications.py +++ b/bot/utils/halloween/spookifications.py @@ -7,7 +7,7 @@ from PIL import ImageOps log = logging.getLogger() -def inversion(im): +def inversion(im: Image) -> Image: """ Inverts the image. @@ -18,7 +18,7 @@ def inversion(im): return inv -def pentagram(im): +def pentagram(im: Image) -> Image: """Adds pentagram to the image.""" im = im.convert('RGB') wt, ht = im.size @@ -28,7 +28,7 @@ def pentagram(im): return im -def bat(im): +def bat(im: Image) -> Image: """ Adds a bat silhoutte to the image. @@ -50,7 +50,7 @@ def bat(im): return im -def get_random_effect(im): +def get_random_effect(im: Image) -> Image: """Randomly selects and applies an effect.""" effects = [inversion, pentagram, bat] effect = choice(effects) |