Skip to content

Commit

Permalink
fix grand and queue
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Aug 15, 2024
1 parent 5329009 commit e0ad3e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions locales/EnglishUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
}
},
"grab": {
"loading": "Loading...",
"description": "Grabs the current playing song on your DM",
"content": "**Duration:** {length}\n**Requested by:** <@{requester}>\n**Link:** [Click here]({uri})",
"check_dm": "Please check your DM.",
Expand Down
6 changes: 4 additions & 2 deletions src/commands/music/Grab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default class Grab extends Command {
public async run(client: Lavamusic, ctx: Context): Promise<any> {
const player = client.queue.get(ctx.guild!.id);

await ctx.sendDeferMessage(ctx.locale("cmd.grab.loading"));

if (!player?.current) {
return await ctx.sendMessage({
embeds: [this.client.embed().setColor(this.client.color.red).setDescription(ctx.locale("player.errors.no_song"))],
Expand Down Expand Up @@ -62,11 +64,11 @@ export default class Grab extends Command {
],
});

return await ctx.sendMessage({
return await ctx.editMessage({
embeds: [this.client.embed().setDescription(ctx.locale("cmd.grab.check_dm")).setColor(this.client.color.green)],
});
} catch (_e) {
return await ctx.sendMessage({
return await ctx.editMessage({
embeds: [this.client.embed().setDescription(ctx.locale("cmd.grab.dm_failed")).setColor(this.client.color.red)],
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Queue extends Map<string, Dispatcher> {
});

this.set(guild.id, dispatcher);
this.client.shoukaku.emit("playerCreate", dispatcher.player);
this.client.shoukaku.emit("playerCreate" as any, dispatcher.player);
}
return dispatcher;
}
Expand Down

0 comments on commit e0ad3e5

Please sign in to comment.