Skip to content

Commit 5d61794

Browse files
committed
appease type checkers
1 parent 54e783d commit 5d61794

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twitchio/ext/commands/builtin_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def convert_Chatter(ctx: "Context", arg: str):
4747
Converts the argument into a chatter in the chat. If the chatter is not found, BadArgument is raised.
4848
"""
4949
arg = arg.lstrip("@")
50-
resp = [x for x in filter(lambda c: c.name == arg, ctx.chatters)]
50+
resp = [x for x in filter(lambda c: c.name == arg, ctx.chatters or tuple())]
5151
if not resp:
5252
raise BadArgument(f"The user '{arg}' was not found in {ctx.channel.name}'s chat.")
5353

@@ -63,6 +63,9 @@ async def convert_PartialChatter(ctx: "Context", arg: str):
6363

6464
async def convert_Clip(ctx: "Context", arg: str):
6565
finder = re.search(r"(https://clips.twitch.tv/)?(?P<slug>.*)", arg)
66+
if not finder:
67+
raise RuntimeError("regex failed to match") # this should never ever raise, but its here to make type checkers happy
68+
6669
slug = finder.group("slug")
6770
clips = await ctx.bot.fetch_clips([slug])
6871
if not clips:

0 commit comments

Comments
 (0)