Fix MusicBot
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Rework the voice commands
|
Play Music
|
||||||
|
|
||||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
# https://gist.github.com/vbe0201/ade9b80f2d3b64643d854938d40a0a2d
|
# https://gist.github.com/vbe0201/ade9b80f2d3b64643d854938d40a0a2d
|
||||||
@@ -146,6 +146,7 @@ class Song:
|
|||||||
))
|
))
|
||||||
embed.add_field(name="Duration", value=self.source.duration)
|
embed.add_field(name="Duration", value=self.source.duration)
|
||||||
embed.add_field(name="Requested by", value=self.requester.mention)
|
embed.add_field(name="Requested by", value=self.requester.mention)
|
||||||
|
embed.add_field(name='URL', value='[Click]({0.source.url})'.format(self))
|
||||||
embed.set_thumbnail(url=self.source.thumbnail)
|
embed.set_thumbnail(url=self.source.thumbnail)
|
||||||
|
|
||||||
return embed
|
return embed
|
||||||
@@ -316,7 +317,7 @@ class Music(commands.Cog):
|
|||||||
"""
|
"""
|
||||||
Shows the current playing song
|
Shows the current playing song
|
||||||
"""
|
"""
|
||||||
await ctx.send(embed=voice_state.current.create_embed())
|
await ctx.send(embed=ctx.voice_state.current.create_embed())
|
||||||
|
|
||||||
@commands.command(name='pause')
|
@commands.command(name='pause')
|
||||||
async def pause(self, ctx: commands.Context):
|
async def pause(self, ctx: commands.Context):
|
||||||
@@ -397,12 +398,14 @@ class Music(commands.Cog):
|
|||||||
if len(ctx.voice_state.songs) == 0:
|
if len(ctx.voice_state.songs) == 0:
|
||||||
return await ctx.send("The queue is empty.")
|
return await ctx.send("The queue is empty.")
|
||||||
|
|
||||||
|
start = 0
|
||||||
|
end = 9
|
||||||
|
|
||||||
queue = ""
|
queue = ""
|
||||||
for i, song in enumerate(ctx.voice_state.songs[start:end], start=start):
|
for i, song in enumerate(ctx.voice_state.songs[start:end], start=start):
|
||||||
queue += '`{0}.` [**{1.source.title}**]({1.source.url})\n'.format(i + 1, song)
|
queue += '`{0}.` [**{1.source.title}**]({1.source.url})\n'.format(i + 1, song)
|
||||||
|
|
||||||
embed = (discord.Embed(description='**{} tracks:**\n\n{}'.format(len(ctx.voice_state.songs), queue))
|
embed = discord.Embed(description='**{} tracks:**\n\n{}'.format(len(ctx.voice_state.songs), queue))
|
||||||
.set_footer(text='Viewing page {}/{}'.format(page, pages)))
|
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ try:
|
|||||||
from config.cogs import __cogs__
|
from config.cogs import __cogs__
|
||||||
from config.status import __activity__
|
from config.status import __activity__
|
||||||
from config.media import __media_anime__, __media_girl__
|
from config.media import __media_anime__, __media_girl__
|
||||||
from config.media import __olli_memes__
|
from config.memes import __olli_memes__
|
||||||
except ImportError as error:
|
except ImportError as error:
|
||||||
print(f"Error while importing: {error}")
|
print(f"Error while importing: {error}")
|
||||||
|
|||||||
Reference in New Issue
Block a user