feat: nowplaying permanente con botones mejorados y cola ordenable (beta)#36
Merged
Conversation
…eta) - NowPlaying se envía automáticamente después de /play y /add - Sin timeout en botones (permanecen activos siempre) - Botón 🔗 Abrir con URL de la canción actual - Barra de progreso se actualiza cada 5s via background task - Cache de detalles Spotify para evitar rate-limiting - Botón 📋 Beta para reordenar cola con modal + vista previa numerada - Removidos providers ISRC/scsearch/spsearch de Lavalink - Healthcheck agregado a Lavalink en docker-compose - NodeDisconnectedEvent/NodeConnectedEvent listeners - Limpieza de estado al salir del servidor
There was a problem hiding this comment.
Pull request overview
Este PR mezcla cambios de infraestructura (Docker Compose/Lavalink) con cambios grandes en el cog de música para habilitar un /nowplaying “permanente” con botones interactivos, historial y refresco automático del embed.
Changes:
- Ajusta la conectividad y healthcheck de Lavalink en
docker-compose.yml(host networking + healthcheck) y cambia cómo el bot resuelve el host de Lavalink. - Simplifica los
lavasrc.providersenlavalink/application.ymlpara usar soloytsearch. - Implementa una nueva UI de Now Playing con botones (pause/skip/stop/loop/prev/shuffle), modal para mover canciones en la cola, historial por guild y un task periódico de actualización.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
lavalink/application.yml |
Reduce proveedores de búsqueda de LavaSrc a ytsearch. |
docker-compose.yml |
Cambia Lavalink a network_mode: host, agrega healthcheck y ajusta LAVALINK_HOST del bot. |
cogs/music.py |
Agrega vista persistente de nowplaying con controles, historial, reorder beta y auto-refresh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
26
to
30
| environment: | ||
| BOT_TOKEN: ${BOT_TOKEN:?set BOT_TOKEN in .env} | ||
| LAVALINK_HOST: lavalink | ||
| LAVALINK_HOST: 172.18.0.1 | ||
| LAVALINK_PORT: 2333 | ||
| LAVALINK_PASSWORD: ${LAVALINK_PASSWORD:?set LAVALINK_PASSWORD in .env} |
Comment on lines
+222
to
+227
| async def _edit(self, interaction: discord.Interaction, embed: discord.Embed): | ||
| if interaction.response.is_done(): | ||
| await interaction.edit_original_response(embed=embed, view=self) | ||
| else: | ||
| await interaction.response.edit_message(embed=embed, view=self) | ||
|
|
Comment on lines
+249
to
+253
| elif child.style == discord.ButtonStyle.url: | ||
| track = self.player.current | ||
| if track and track.uri: | ||
| child._url = track.uri | ||
| continue |
Comment on lines
+579
to
+588
| spotify_details: dict | None = None | ||
| if (track.uri or "").startswith("https://open.spotify.com/track/"): | ||
| parsed = parse_spotify_url(track.uri) | ||
| if parsed and SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET: | ||
| try: | ||
| spotify_details = await get_track_details( | ||
| parsed[1], SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET | ||
| ) | ||
| except Exception: | ||
| pass |
Comment on lines
+171
to
+174
| async def on_submit(self, interaction: discord.Interaction): | ||
| queue = self.player.queue | ||
| if not queue: | ||
| return await interaction.response.send_message("La cola está vacía.", ephemeral=True) |
Comment on lines
+1991
to
1994
| @app_commands.command(name="nowplaying", description="Muestra la canción actual con controles interactivos") | ||
| async def nowplaying(self, interaction: discord.Interaction): | ||
| """Ver canción actual""" | ||
| """Ver canción actual con botones de control""" | ||
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Esta solicitud de extracción actualiza la configuración de Docker Compose y Lavalink para mejorar la conectividad y la monitorización del estado del servicio, así como para simplificar la configuración de los proveedores de búsqueda. Los principales cambios afectan a la forma en que se conecta y monitoriza el servicio Lavalink, cómo se conecta el bot a Lavalink y qué proveedores de búsqueda están habilitados.
Docker Compose y Redes:
Se modificó el servicio
lavalinkendocker-compose.ymlpara usarnetwork_mode: hosty se eliminó la asignación deports, lo que permite que Lavalink se conecte directamente a la red del host.Se añadió una comprobación de estado al servicio
lavalinkpara monitorizar su estado mediante una solicitud HTTP.Se actualizó la variable de entorno
LAVALINK_HOSTdel servicio del bot para usar la IP de la puerta de enlace de la red del host (172.18.0.1) en lugar del nombre del servicio, lo que garantiza la conectividad con Lavalink al usar la red del host.Proveedores de búsqueda de Lavalink:
lavasrc.providersenlavalink/application.ymleliminando los proveedores de búsqueda ISRC, SoundCloud y Spotify, dejando habilitada únicamente la búsqueda genérica de YouTube.