mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-17 03:00:13 +00:00
Fix error on displaying switch history
Fix CommandError being raised when issuing `pk;switch` with no parameters
This commit is contained in:
parent
15ccc4e27a
commit
6eae3c02fa
1 changed files with 1 additions and 3 deletions
|
|
@ -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
|
# 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`.")
|
#raise CommandError("You must use a subcommand. For a list of subcommands, type `pk;help member`.")
|
||||||
await system_fronthistory(ctx, await ctx.ensure_system())
|
await system_fronthistory(ctx, await ctx.ensure_system())
|
||||||
|
return
|
||||||
if ctx.match("out"):
|
if ctx.match("out"):
|
||||||
await switch_out(ctx)
|
await switch_out(ctx)
|
||||||
elif ctx.match("move"):
|
elif ctx.match("move"):
|
||||||
|
|
@ -28,9 +29,6 @@ async def switch_root(ctx: CommandContext):
|
||||||
async def switch_member(ctx: CommandContext):
|
async def switch_member(ctx: CommandContext):
|
||||||
system = await ctx.ensure_system()
|
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] = []
|
members: List[Member] = []
|
||||||
while ctx.has_next():
|
while ctx.has_next():
|
||||||
members.append(await ctx.pop_member())
|
members.append(await ctx.pop_member())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue