playpause
This commit is contained in:
parent
c085feea71
commit
86aa68845f
@ -351,16 +351,34 @@ presets: {shlex.join(allowed_presets)}
|
||||
case _:
|
||||
raise Explicit("misformatted")
|
||||
|
||||
@at("||")
|
||||
@at("⏸")
|
||||
@at("⏸️")
|
||||
@at("pause")
|
||||
async def pause(ctx: Context, _args: list[str]) -> None:
|
||||
vc = await mainservice.context(ctx, create=False, force_play=False).vc()
|
||||
vc.pause()
|
||||
|
||||
@at("|>")
|
||||
@at(">")
|
||||
@at("⏵")
|
||||
@at("resume")
|
||||
async def resume(ctx: Context, _args: list[str]) -> None:
|
||||
vc = await mainservice.context(ctx, create=False, force_play=True).vc()
|
||||
vc.resume()
|
||||
|
||||
@at(".")
|
||||
@at("⏯")
|
||||
@at("⏯️")
|
||||
@at("pp")
|
||||
@at("playpause")
|
||||
async def playpause(ctx: Context, _args: list[str]) -> None:
|
||||
vc = await mainservice.context(ctx, create=False, force_play=True).vc()
|
||||
if vc.is_paused():
|
||||
vc.resume()
|
||||
else:
|
||||
vc.pause()
|
||||
|
||||
@at("leave")
|
||||
async def leave(ctx: Context, _args: list[str]) -> None:
|
||||
async with mainservice.lock_for(ctx.guild):
|
||||
|
Loading…
Reference in New Issue
Block a user