Skip to content

Commit

Permalink
update fix autoplay
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Sep 17, 2024
1 parent 7c51db2 commit 9dfa60b
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"organizeImports": {
"enabled": true
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"homepage": "https://github.com/appujet/lavamusic#readme",
"devDependencies": {
"@biomejs/biome": "^1.9.0",
"@biomejs/biome": "^1.9.1",
"@types/i18n": "^0.13.12",
"@types/node": "^22.5.5",
"@types/signale": "^1.4.7",
Expand All @@ -48,7 +48,7 @@
"dotenv": "^16.4.5",
"genius-lyrics-api": "^3.2.1",
"i18n": "^0.15.1",
"lavalink-client": "https://pkg.pr.new/moe-music/lavalink-client@b5bd496",
"lavalink-client": "https://pkg.pr.new/moe-music/lavalink-client@0b0f590",
"node-system-stats": "^1.3.0",
"signale": "^1.4.0",
"topgg-autoposter": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/filters/Pitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ export default class Pitch extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
2 changes: 1 addition & 1 deletion src/commands/filters/Rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ export default class Rate extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
2 changes: 1 addition & 1 deletion src/commands/filters/Reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ export default class Reset extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
4 changes: 2 additions & 2 deletions src/commands/filters/Rotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class Rotation extends Command {
public async run(client: Lavamusic, ctx: Context): Promise<any> {
const player = client.manager.getPlayer(ctx.guild!.id);
if (player.filterManager.filters.rotation) {
player.filterManager.toggleRotation();
player.filterManager.toggleRotation();
await ctx.sendMessage({
embeds: [
{
Expand Down Expand Up @@ -65,4 +65,4 @@ export default class Rotation extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
2 changes: 1 addition & 1 deletion src/commands/filters/Speed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ export default class Speed extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
4 changes: 2 additions & 2 deletions src/commands/filters/Tremolo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Tremolo extends Command {

public async run(client: Lavamusic, ctx: Context): Promise<any> {
const player = client.manager.getPlayer(ctx.guild!.id);
const tremoloEnabled = player.filterManager.filters.tremolo
const tremoloEnabled = player.filterManager.filters.tremolo;

if (tremoloEnabled) {
player.filterManager.toggleTremolo();
Expand Down Expand Up @@ -67,4 +67,4 @@ export default class Tremolo extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
4 changes: 2 additions & 2 deletions src/commands/filters/Vibrato.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Vibrato extends Command {

public async run(client: Lavamusic, ctx: Context): Promise<any> {
const player = client.manager.getPlayer(ctx.guild!.id);
const vibratoEnabled = player.filterManager.filters.vibrato
const vibratoEnabled = player.filterManager.filters.vibrato;

if (vibratoEnabled) {
player.filterManager.toggleVibrato();
Expand Down Expand Up @@ -67,4 +67,4 @@ export default class Vibrato extends Command {
* This code is the property of Coder and may not be reproduced or
* modified without permission. For more information, contact us at
* https://discord.gg/ns8CTk9J3e
*/
*/
8 changes: 6 additions & 2 deletions src/commands/music/Play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export default class Play extends Command {
const focusedValue = interaction.options.getFocused();

if (!focusedValue) {
return interaction.respond([]).catch(() => { null });
return interaction.respond([]).catch(() => {
null;
});
}

const res = await this.client.manager.search(focusedValue, interaction.user);
Expand All @@ -118,7 +120,9 @@ export default class Play extends Command {
});
}

return await interaction.respond(songs).catch(() => { null });
return await interaction.respond(songs).catch(() => {
null;
});
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/events/client/SetupSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class SetupSystem extends Event {
if (!(channel instanceof TextChannel)) return;
if (!message.member?.voice.channel) {
await oops(channel, T(locale, "event.message.no_voice_channel_queue"));
await message.delete().catch(() => { });
await message.delete().catch(() => {});
return;
}

Expand All @@ -31,7 +31,7 @@ export default class SetupSystem extends Event {
channel: voiceChannel.id,
}),
);
await message.delete().catch(() => { });
await message.delete().catch(() => {});
return;
}

Expand All @@ -42,7 +42,7 @@ export default class SetupSystem extends Event {
channel: clientMember.voice.channelId,
}),
);
await message.delete().catch(() => { });
await message.delete().catch(() => {});
return;
}

Expand All @@ -61,7 +61,7 @@ export default class SetupSystem extends Event {
}

await setupStart(this.client, message.content, player, message);
await message.delete().catch(() => { });
await message.delete().catch(() => {});
}
}

Expand Down
1 change: 0 additions & 1 deletion src/events/node/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default class Connect extends Event {
textChannelId: channel.id,
selfDeaf: true,
selfMute: false,

});
if (!player.connected) await player.connect();
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions src/events/player/QueueEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export default class QueueEnd extends Event {
const channel = guild.channels.cache.get(player.textChannelId) as TextChannel;
if (!channel) return;

const message = await channel.messages.fetch(messageId).catch(() => { });
const message = await channel.messages.fetch(messageId).catch(() => {});
if (!message) return;

if (message.editable) {
await message.edit({ components: [] }).catch(() => { });
await message.edit({ components: [] }).catch(() => {});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/structures/LavalinkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class LavalinkClient extends LavalinkManager {
defaultSearchPlatform: client.env.SEARCH_ENGINE,
onDisconnect: {
autoReconnect: true,
destroyPlayer: false
destroyPlayer: false,
},
requesterTransformer: requesterTransformer,
onEmptyQueue: {
Expand Down

0 comments on commit 9dfa60b

Please sign in to comment.