Skip to content

Commit

Permalink
[Discord] Improve audio command documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Nov 20, 2023
1 parent f4c06b0 commit 1006603
Showing 1 changed file with 35 additions and 11 deletions.
46 changes: 35 additions & 11 deletions Discord/cogs/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,25 @@ async def cog_check(self, ctx):
"soundcloud", "voice", "stream", "play", "playlist", "budio",
"music", "download"
],
description = "Supports [these sites](https://rg3.github.io/youtube-dl/supportedsites.html) and Spotify",
case_insensitive = True,
fallback = "play"
)
@commands.check_any(checks.is_permitted(), checks.is_guild_owner())
async def audio(self, ctx, *, query: str):
'''
Audio System - play a song
Play audio
All audio subcommands are also commands
For cleanup of audio commands, the Manage Messages permission is required
Supported sites:
https://rg3.github.io/youtube-dl/supportedsites.html
Spotify
Parameters
----------
query
Audio to play
'''
# Note: spotify command invokes this command
# Note: youtube command invokes this command
Expand Down Expand Up @@ -102,16 +111,23 @@ async def audio(self, ctx, *, query: str):
finally:
await response.edit(embed = embed)

@commands.group(
case_insensitive = True, invoke_without_command = True,
description = "Supports [these sites](https://rg3.github.io/youtube-dl/supportedsites.html) and Spotify"
)
@commands.group(case_insensitive = True, invoke_without_command = True)
@commands.check_any(checks.is_permitted(), checks.is_guild_owner())
async def spotify(self, ctx, *, query: str):
'''
Audio System - play a song
Play audio
All audio subcommands are also commands
For cleanup of audio commands, the Manage Messages permission is required
Supported sites:
https://rg3.github.io/youtube-dl/supportedsites.html
Spotify
Parameters
----------
query
Audio to play
'''
if command := ctx.bot.get_command("audio"):
await ctx.invoke(command, query = query)
Expand All @@ -133,16 +149,24 @@ async def spotify_information(self, ctx, url: str):
)

@commands.hybrid_group(
aliases = ["yt"],
case_insensitive = True, with_app_command = False,
description = "Supports [these sites](https://rg3.github.io/youtube-dl/supportedsites.html) and Spotify",
aliases = ["yt"], case_insensitive = True, with_app_command = False
)
@commands.check_any(checks.is_permitted(), checks.is_guild_owner())
async def youtube(self, ctx, *, query: str):
'''
Audio System - play a song
Play audio
All audio subcommands are also commands
For cleanup of audio commands, the Manage Messages permission is required
Supported sites:
https://rg3.github.io/youtube-dl/supportedsites.html
Spotify
Parameters
----------
query
Audio to play
'''
if command := ctx.bot.get_command("audio"):
await ctx.invoke(command, query = query)
Expand Down

0 comments on commit 1006603

Please sign in to comment.