aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar Kieran Siek <[email protected]>2019-09-14 01:09:53 +0800
committerGravatar GitHub <[email protected]>2019-09-14 01:09:53 +0800
commite1dab123fc77986b09dc622457886635eb26d4ab (patch)
treebf38f7863925b393326edf4dc04453508e545a2b /bot/utils/__init__.py
parentMerge pull request #269 from python-discord/hacktoberfest-update (diff)
parentFix incorrect merge conflict resolutions, lint remaining items (diff)
Merge pull request #270 from python-discord/flake8-annotations
Add Flake8 annotations
Diffstat (limited to 'bot/utils/__init__.py')
-rw-r--r--bot/utils/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/utils/__init__.py b/bot/utils/__init__.py
index 72a681a3..0aa50af6 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]