Removed controls

This commit is contained in:
2022-11-13 16:07:01 +01:00
parent ffb7dc999f
commit 765b23e8fe
3 changed files with 2 additions and 20 deletions
+1 -2
View File
@@ -53,11 +53,10 @@ class MusicCog(BaseCog, name="Music"):
channel_id = int(event.player.fetch("channel")) channel_id = int(event.player.fetch("channel"))
channel: TextChannel = self.bot.get_channel(channel_id) channel: TextChannel = self.bot.get_channel(channel_id)
controls = track_embed.create_embed_controls(self.bot)
embed = track_embed.create_track_embed( embed = track_embed.create_track_embed(
event.player.current, event.player.queue, [] event.player.current, event.player.queue, []
) )
await channel.send(embed=embed, view=controls) await channel.send(embed=embed)
elif isinstance(event, lavalink.events.TrackEndEvent): elif isinstance(event, lavalink.events.TrackEndEvent):
await helper.fill_player_queue(self.bot, event.player, 1) await helper.fill_player_queue(self.bot, event.player, 1)
+1 -2
View File
@@ -85,9 +85,8 @@ class MusicCommands(app_commands.Group):
await ctx.response.send_message(embed=embed) await ctx.response.send_message(embed=embed)
return return
controls = track_embed.create_embed_controls(self.bot)
embed = track_embed.create_track_embed(player.current, player.queue, []) embed = track_embed.create_track_embed(player.current, player.queue, [])
await ctx.response.send_message(embed=embed, view=controls) await ctx.response.send_message(embed=embed)
@app_commands.command(name="queue", description="See what's ahead") @app_commands.command(name="queue", description="See what's ahead")
async def queue(self, ctx: Interaction): async def queue(self, ctx: Interaction):
-16
View File
@@ -70,19 +70,3 @@ def create_track_embed(
embed.set_image(url=f"https://i3.ytimg.com/vi/{current.identifier}/mqdefault.jpg") embed.set_image(url=f"https://i3.ytimg.com/vi/{current.identifier}/mqdefault.jpg")
embed.set_footer(text=f"Uploaded by: {current.author}") embed.set_footer(text=f"Uploaded by: {current.author}")
return embed return embed
def create_embed_controls(bot: "TuneBot") -> "EmbedControls":
return EmbedControls(bot)
class EmbedControls(discord.ui.View):
def __init__(self, bot: "TuneBot"):
super().__init__()
self.bot = bot
@discord.ui.button(label="Skip")
async def skip(self, ctx: discord.Interaction, button: discord.ui.Button):
player = helper.get_player(ctx.client, ctx.guild_id)
await player.skip()
await ctx.response.defer()