refactor(commands/voice/queue): clean up argument parsing groups
This commit is contained in:
parent
786de8412b
commit
a05c14263b
@ -1,9 +1,10 @@
|
|||||||
import arguments
|
import arguments
|
||||||
import commands
|
|
||||||
import utils
|
|
||||||
import youtubedl
|
import youtubedl
|
||||||
from state import client, players
|
from state import client, players
|
||||||
|
|
||||||
|
import commands
|
||||||
|
import utils
|
||||||
|
|
||||||
|
|
||||||
async def queue_or_play(message):
|
async def queue_or_play(message):
|
||||||
await ensure_joined(message)
|
await ensure_joined(message)
|
||||||
@ -18,27 +19,26 @@ async def queue_or_play(message):
|
|||||||
tokens[0], "queue a song, list the queue, or resume playback"
|
tokens[0], "queue a song, list the queue, or resume playback"
|
||||||
)
|
)
|
||||||
parser.add_argument("query", nargs="?", help="yt-dlp URL or query to get song")
|
parser.add_argument("query", nargs="?", help="yt-dlp URL or query to get song")
|
||||||
group = parser.add_mutually_exclusive_group()
|
parser.add_argument(
|
||||||
group.add_argument(
|
|
||||||
"-v",
|
"-v",
|
||||||
"--volume",
|
"--volume",
|
||||||
default=50,
|
default=50,
|
||||||
type=lambda v: arguments.range_type(v, min=0, max=150),
|
type=lambda v: arguments.range_type(v, min=0, max=150),
|
||||||
help="the volume level (0 - 150)",
|
help="the volume level (0 - 150)",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
parser.add_argument(
|
||||||
"-i",
|
"-i",
|
||||||
"--remove-index",
|
"--remove-index",
|
||||||
type=int,
|
type=int,
|
||||||
help="remove a queued song by index",
|
help="remove a queued song by index",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
parser.add_argument(
|
||||||
"-m",
|
"-m",
|
||||||
"--remove-multiple",
|
"--remove-multiple",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="continue removing queued songs after finding a match",
|
help="continue removing queued songs after finding a match",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c",
|
||||||
"--clear",
|
"--clear",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user