Adding prev and history command

This commit is contained in:
Rafael Vargas
2022-01-11 21:46:09 -04:00
parent c41a6a6c8a
commit 5063c45e87
3 changed files with 135 additions and 17 deletions

View File

@@ -49,7 +49,7 @@ class Music(commands.Cog):
if player == None:
return
else:
await player.skip()
await player.skip(ctx)
@commands.command(name='stop', help=config.HELP_STOP, aliases=['parar'])
async def stop(self, ctx) -> None:
@@ -79,6 +79,29 @@ class Music(commands.Cog):
if success:
await self.__send_embed(ctx, config.SONG_PLAYER, config.SONG_RESUMED, 'blue')
@commands.command(name='prev', help=config.HELP_PREV, aliases=['anterior'])
async def prev(self, ctx) -> None:
player = self.__get_player(ctx)
if player == None:
return
if is_connected(ctx) == None:
success = await player.connect(ctx)
if success == False:
await self.__send_embed(ctx, config.ERROR_TITLE, config.NO_CHANNEL, 'red')
return
await player.play_prev(ctx)
@commands.command(name='history', help=config.HELP_HISTORY, aliases=['historico'])
async def history(self, ctx) -> None:
player = self.__get_player(ctx)
if player == None:
return
else:
embed = player.history()
await ctx.send(embed=embed)
@commands.command(name='loop', help=config.HELP_LOOP, aliases=['l', 'repeat'])
async def loop(self, ctx, args: str) -> None:
player = self.__get_player(ctx)