From d84a4339f105774edbaaff27a9ee44411770d0ce Mon Sep 17 00:00:00 2001 From: TheBluekr Date: Fri, 27 Oct 2023 15:41:18 +0200 Subject: [PATCH 1/5] Fix "did not respond" with slash commands --- cogs/lavalink.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/cogs/lavalink.py b/cogs/lavalink.py index 096522f..839987d 100644 --- a/cogs/lavalink.py +++ b/cogs/lavalink.py @@ -104,7 +104,7 @@ async def play(self, interaction: discord.Interaction, url: str=None): embed = self.embed.create_embed(interaction.user) if(url): - tracks = await wavelink.NodePool.get_tracks(url, wavelink.YouTubeTrack) + tracks = await wavelink.NodePool.get_tracks(url, cls=wavelink.YouTubeTrack) if(not tracks): embed.description = f"Could not find tracks with url: `{url}`" return await interaction.response.send_message(embed=embed) @@ -137,12 +137,12 @@ async def add(self, interaction: discord.Interaction, url: str): else: vc: wavelink.Player = interaction.guild.voice_client - tracks = await wavelink.NodePool.get_tracks(url, wavelink.YouTubeTrack) + tracks = await wavelink.NodePool.get_tracks(url, cls=wavelink.YouTubeTrack) if(not tracks): embed.description = f"Could not find tracks with url: `{url}`" return await interaction.response.send_message(embed=embed) - track = Track(tracks[0].id, tracks[0].info, requester=interaction.user) + track = Track(interaction.user, tracks[0]) embed.description = f"**Added**:\n**[{track.title}](https://www.youtube.com/watch?v={track.identifier} '{track.identifier}')**" embed.set_footer(text=f"Requested by: {track.requester}", icon_url=track.requester.avatar.url) @@ -159,7 +159,7 @@ async def add(self, interaction: discord.Interaction, url: str): @check_voice_user() @music.command() async def search(self, interaction: discord.Interaction, query: str): - tracks = await wavelink.NodePool.get_tracks(query, wavelink.YouTubeTrack) + tracks = await wavelink.NodePool.get_tracks(query, cls=wavelink.YouTubeTrack) embed = self.embed.create_embed(interaction.user) @@ -259,9 +259,19 @@ async def stop(self, interaction: discord.Interaction): async def skip(self, interaction: discord.Interaction): """Skips the current playing song. """ + embed = self.embed.create_embed(interaction.user) + + if not interaction.guild.voice_client: + embed.description = "Not connected to voice" + return await interaction.response.send_message(embed=embed) + vc: wavelink.Player = interaction.guild.voice_client await vc.stop(force=True) + + embed.description = "Skipped current song" + + await interaction.response.send_message(embed=embed) @commands.guild_only() @check_voice_user() @@ -287,8 +297,18 @@ async def volume(self, interaction: discord.Interaction, volume: app_commands.Ra @music.command(description="Sets the current position in the track to the specified time") async def set(self, interaction: discord.Interaction, position: float): """Sets the current playback to the specified time (in seconds)""" + embed = self.embed.create_embed(interaction.user) + + if not interaction.guild.voice_client: + embed.description = "Not connected to voice" + return await interaction.response.send_message(embed=embed) + vc: wavelink.Player = interaction.guild.voice_client await vc.seek(round(position*1000.0)) + + embed.description = f"Set playback to {position}s" + + await interaction.response.send_message(embed=embed) @commands.guild_only() @check_voice_user() From 618e4cc2fde43f41b9846e89c060504272017765 Mon Sep 17 00:00:00 2001 From: TheBluekr Date: Fri, 10 Nov 2023 13:00:19 +0100 Subject: [PATCH 2/5] Begin testing github-ci --- .github/workflows/deploy-stable.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/deploy-stable.yml diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml new file mode 100644 index 0000000..8ada994 --- /dev/null +++ b/.github/workflows/deploy-stable.yml @@ -0,0 +1,21 @@ +name: remote ssh command +on: [push] + branches: + - Stable +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + cd ${{ secrets.WORK_DIR }} + pwd + git pull + cd .. + docker-compose restart \ No newline at end of file From cc6d7a73d26831d18884cce9f999433e5f9778bc Mon Sep 17 00:00:00 2001 From: TheBluekr Date: Fri, 10 Nov 2023 13:02:53 +0100 Subject: [PATCH 3/5] Update github-ci --- .github/workflows/deploy-stable.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index 8ada994..b8035af 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -1,13 +1,14 @@ name: remote ssh command -on: [push] - branches: - - Stable +on: + push: + branches: + - Stable jobs: build: name: Build runs-on: ubuntu-latest steps: - - name: executing remote ssh commands using password + - name: executing remote ssh commands using key uses: appleboy/ssh-action@v1.0.0 with: host: ${{ secrets.SSH_HOST }} From af6ece01cf24e1eb24ea566f4a35db0b59dcd65e Mon Sep 17 00:00:00 2001 From: TheBluekr Date: Fri, 10 Nov 2023 13:10:00 +0100 Subject: [PATCH 4/5] Add manual trigger to CI --- .github/workflows/deploy-stable.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index b8035af..7b6afb6 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -3,6 +3,9 @@ on: push: branches: - Stable + workflow_dispatch: + branches: + - Stable jobs: build: name: Build From 7360b3bd248c9cfd74cf9d0a5a2f290cb3fa30ab Mon Sep 17 00:00:00 2001 From: TheBluekr Date: Fri, 10 Nov 2023 13:11:29 +0100 Subject: [PATCH 5/5] Add pull request --- .github/workflows/deploy-stable.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index 7b6afb6..7e38ab5 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -3,6 +3,9 @@ on: push: branches: - Stable + pull_request: + branches: + - Stable workflow_dispatch: branches: - Stable