Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V3 Audio] Play local folders via text command #2457

Merged
merged 2 commits into from
Feb 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions redbot/cogs/audio/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,22 @@ async def local(self, ctx):
"""Local playback commands."""
pass

@local.command(name="folder")
async def local_folder(self, ctx):
@local.command(name="folder", aliases=["start"])
async def local_folder(self, ctx, folder=None):
"""Play all songs in a localtracks folder."""
if not await self._localtracks_check(ctx):
return
await ctx.invoke(self.local_play)
if not folder:
await ctx.invoke(self.local_play)
else:
try:
folder_path = os.getcwd() + "/localtracks/{}/".format(folder)
os.listdir(folder_path)
except OSError:
return await self._embed_msg(
ctx, _("No localtracks folder named {name}.").format(name=folder)
)
await self._local_play_all(ctx, folder)

@local.command(name="play")
async def local_play(self, ctx):
Expand Down