Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: removesong command is not working #779

Closed
Kropatz opened this issue Jan 16, 2025 · 1 comment · Fixed by #780
Closed

[Bug]: removesong command is not working #779

Kropatz opened this issue Jan 16, 2025 · 1 comment · Fixed by #780
Assignees

Comments

@Kropatz
Copy link
Contributor

Kropatz commented Jan 16, 2025

Bug description

The bot doesn't remove the song from the playlist, because the code is commented out.

Steps to reproduce

  1. Type !removesong playlistname songname
  2. Expect the song to be removed, but nothing happens

Operating System

Alpine 3.3.0

Node.js version

v22.11.0

java version

No response

Application/Library version

5.0.0-beta

Error logs or screenshots

No response

Additional context

No response

@Kropatz Kropatz changed the title [Bug]: removesong is not working [Bug]: removesong command is not working Jan 16, 2025
@Kropatz
Copy link
Contributor Author

Kropatz commented Jan 16, 2025

Something like this might work:

diff --git a/src/commands/playlist/RemoveSong.ts b/src/commands/playlist/RemoveSong.ts
index ca60f6a9..e1cc5a87 100644
--- a/src/commands/playlist/RemoveSong.ts
+++ b/src/commands/playlist/RemoveSong.ts
@@ -75,9 +75,9 @@ export default class RemoveSong extends Command {
 			return await ctx.sendMessage({ embeds: [playlistNotFoundError] });
 		}
 
-		/* const res = await client.queue.search(song);
+		const res = await client.manager.search(song, ctx.author);
 
-        if (!res || res.loadType !== LoadType.TRACK) {
+        if (!res || res.loadType !== "track") {
             const noSongsFoundError = this.client
                 .embed()
                 .setDescription(ctx.locale("cmd.removesong.messages.song_not_found"))
@@ -85,10 +85,10 @@ export default class RemoveSong extends Command {
             return await ctx.sendMessage({ embeds: [noSongsFoundError] });
         }
 
-        const trackToRemove = res.data;
+        const trackToRemove = res.tracks[0];
 
         try {
-            await client.db.removeSong(ctx.author.id, playlist, trackToRemove.encoded);
+            await client.db.removeSong(ctx.author!.id, playlist, trackToRemove.encoded!);
 
             const successMessage = this.client
                 .embed()
@@ -107,7 +107,7 @@ export default class RemoveSong extends Command {
                 .setDescription(ctx.locale("cmd.removesong.messages.error_occurred"))
                 .setColor(this.client.color.red);
             return await ctx.sendMessage({ embeds: [genericError] });
-        } */
+        }
 	}
 	public async autocomplete(interaction: AutocompleteInteraction): Promise<void> {
 		const focusedValue = interaction.options.getFocused();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants