From 6eae3c02fa3f5cdd044746dbc9626656c5abb585 Mon Sep 17 00:00:00 2001 From: xBelladonna Date: Sat, 15 Jun 2019 12:29:19 +0930 Subject: [PATCH] Fix error on displaying switch history Fix CommandError being raised when issuing `pk;switch` with no parameters --- src/pluralkit/bot/commands/switch_commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pluralkit/bot/commands/switch_commands.py b/src/pluralkit/bot/commands/switch_commands.py index ed65a61f..0a40f3d6 100644 --- a/src/pluralkit/bot/commands/switch_commands.py +++ b/src/pluralkit/bot/commands/switch_commands.py @@ -15,6 +15,7 @@ async def switch_root(ctx: CommandContext): # We could raise an error here, but we display the system front history instead as a shortcut #raise CommandError("You must use a subcommand. For a list of subcommands, type `pk;help member`.") await system_fronthistory(ctx, await ctx.ensure_system()) + return if ctx.match("out"): await switch_out(ctx) elif ctx.match("move"): @@ -28,9 +29,6 @@ async def switch_root(ctx: CommandContext): async def switch_member(ctx: CommandContext): system = await ctx.ensure_system() - if not ctx.has_next(): - raise CommandError("You must pass at least one member name or ID to register a switch to.") - members: List[Member] = [] while ctx.has_next(): members.append(await ctx.pop_member())