From 196f30dc46b8a1de0b2cbdb9cf396661d23c7629 Mon Sep 17 00:00:00 2001 From: LucasB25 <50886682+LucasB25@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:31:05 +0200 Subject: [PATCH] chore: update & play(next) --- .env.example | 2 -- commitlint.config.js | 2 +- package.json | 12 ++++---- scripts/clean.js | 11 +++++++ scripts/restart.js | 11 +++++++ src/commands/config/247.ts | 4 +-- src/commands/config/Language.ts | 11 +++++++ src/commands/music/Join.ts | 4 +-- src/commands/music/Loop.ts | 2 +- src/commands/music/Play.ts | 42 +++++++++++++++----------- src/commands/music/PlayNext.ts | 43 ++++++++++++++++----------- src/commands/music/Search.ts | 25 ++++++++-------- src/commands/music/Shuffle.ts | 2 +- src/commands/music/Stop.ts | 2 +- src/commands/playlist/Load.ts | 2 +- src/database/server.ts | 2 +- src/env.ts | 11 +++++++ src/events/client/ChannelDelete.ts | 11 +++++++ src/events/client/VoiceStateUpdate.ts | 1 - src/events/node/Connect.ts | 11 +++++++ src/events/node/Destroy.ts | 11 +++++++ src/events/player/QueueEnd.ts | 17 +++++++++-- src/events/player/TrackEnd.ts | 19 +++++++++--- src/shard.ts | 11 +++++++ src/structures/LavalinkClient.ts | 11 +++++++ src/structures/Lavamusic.ts | 6 ++-- src/utils/Buttons.ts | 13 +++++++- src/utils/ThemeSelector.ts | 11 +++++++ src/utils/functions/player.ts | 11 +++++++ 29 files changed, 243 insertions(+), 78 deletions(-) diff --git a/.env.example b/.env.example index f1f299634..ac3eab50f 100644 --- a/.env.example +++ b/.env.example @@ -14,7 +14,5 @@ BOT_ACTIVITY=" Lavamusic" # Your bot activity. DATABASE_URL= "" # Your database url (If you want to use sqlite, then you can leave it blank.). AUTO_NODE=" false" # true for auto node. It is given from lavainfo-api (https://lavainfo-api.deno.dev). SEARCH_ENGINE= "YouTubeMusic" # Search engine to be used when playing the song. You can use: YouTube, YouTubeMusic, SoundCloud, Spotify, Apple, Deezer, Yandex and JioSaavn -MAX_PLAYLIST_SIZE= "100" # Max playlist size. -MAX_QUEUE_SIZE= "100" # Max queue size. GENIUS_API= "" # Sign up and get your own api at (https://genius.com/) to fetch your lyrics (CLIENT TOKEN) NODES=[{"id":"main","host":"localhost","port":2333,"authorization":"youshallnotpass"}] diff --git a/commitlint.config.js b/commitlint.config.js index 8567d51d7..5073c20db 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1 @@ -module.exports = { extends: ["@commitlint/config-conventional"] }; \ No newline at end of file +module.exports = { extends: ["@commitlint/config-conventional"] }; diff --git a/package.json b/package.json index b4d1204ce..88002e541 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lavamusic", - "version": "4.6.7", + "version": "5.0.0-beta", "description": "LavaMusic is a music bot for Discord, written in JavaScript using the Discord.js, Typescript, lavalink-client (Lavalink) library.", "main": "dist/index.js", "scripts": { @@ -36,9 +36,9 @@ "devDependencies": { "@biomejs/biome": "^1.9.0", "@types/i18n": "^0.13.12", - "@types/node": "^22.5.4", - "@commitlint/cli": "^19.4.0", - "@commitlint/config-conventional": "^19.2.2", + "@types/node": "^22.5.5", + "@commitlint/cli": "^19.5.0", + "@commitlint/config-conventional": "^19.5.0", "@types/signale": "^1.4.7", "husky": "^9.1.6", "lint-staged": "^15.2.10", @@ -61,9 +61,7 @@ "zod": "^3.23.8" }, "lint-staged": { - "*.ts": [ - "biome check --write" - ] + "*.ts": ["biome check --write"] }, "signale": { "displayScope": true, diff --git a/scripts/clean.js b/scripts/clean.js index 671a864e4..d2f1cc37d 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -15,3 +15,14 @@ async function clean() { } clean(); + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/scripts/restart.js b/scripts/restart.js index d377f4397..bd87dda89 100644 --- a/scripts/restart.js +++ b/scripts/restart.js @@ -13,3 +13,14 @@ async function startLavamusic() { } setTimeout(startLavamusic, 5000); + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/commands/config/247.ts b/src/commands/config/247.ts index 7e531c3df..7d123b046 100644 --- a/src/commands/config/247.ts +++ b/src/commands/config/247.ts @@ -33,7 +33,7 @@ export default class _247 extends Command { public async run(client: Lavamusic, ctx: Context): Promise { const embed = this.client.embed(); - let player = client.manager.getPlayer(ctx.guild.id) + let player = client.manager.getPlayer(ctx.guild.id); try { const data = await client.db.get_247(ctx.guild!.id); const member = ctx.member as GuildMember; @@ -58,7 +58,7 @@ export default class _247 extends Command { selfDeaf: true, instaUpdateFiltersFix: true, vcRegion: member.voice.channel.rtcRegion, - }) + }); } if (!player.connected) await player.connect(); return await ctx.sendMessage({ diff --git a/src/commands/config/Language.ts b/src/commands/config/Language.ts index e90de4ea9..011afff35 100644 --- a/src/commands/config/Language.ts +++ b/src/commands/config/Language.ts @@ -145,3 +145,14 @@ export default class LanguageCommand extends Command { await interaction.respond(filtered.slice(0, 25)).catch(console.error); } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/commands/music/Join.ts b/src/commands/music/Join.ts index 5b744ae81..62214373a 100644 --- a/src/commands/music/Join.ts +++ b/src/commands/music/Join.ts @@ -47,7 +47,7 @@ export default class Join extends Command { }); } - const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel + const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel; if (!memberVoiceChannel) { return await ctx.sendMessage({ embeds: [embed.setColor(this.client.color.red).setDescription(ctx.locale("cmd.join.no_voice_channel"))], @@ -62,7 +62,7 @@ export default class Join extends Command { selfDeaf: true, instaUpdateFiltersFix: true, vcRegion: memberVoiceChannel.rtcRegion, - }) + }); if (!player.connected) await player.connect(); return await ctx.sendMessage({ embeds: [ diff --git a/src/commands/music/Loop.ts b/src/commands/music/Loop.ts index 817f74cd5..6e1785b87 100644 --- a/src/commands/music/Loop.ts +++ b/src/commands/music/Loop.ts @@ -37,7 +37,7 @@ export default class Loop extends Command { switch (player?.repeatMode) { case "off": - player.setRepeatMode("track") + player.setRepeatMode("track"); loopMessage = ctx.locale("cmd.loop.looping_song"); break; case "track": diff --git a/src/commands/music/Play.ts b/src/commands/music/Play.ts index 00e29a91a..4e202ef1f 100644 --- a/src/commands/music/Play.ts +++ b/src/commands/music/Play.ts @@ -1,6 +1,6 @@ import type { AutocompleteInteraction, VoiceChannel } from "discord.js"; -import { Command, type Context, type Lavamusic } from "../../structures/index"; import type { SearchResult } from "lavalink-client/dist/types"; +import { Command, type Context, type Lavamusic } from "../../structures/index"; export default class Play extends Command { constructor(client: Lavamusic) { @@ -49,20 +49,21 @@ export default class Play extends Command { const query = args.join(" "); await ctx.sendDeferMessage(ctx.locale("cmd.play.loading")); let player = client.manager.getPlayer(ctx.guild!.id); - const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel + const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel; - if (!player) player = client.manager.createPlayer({ - guildId: ctx.guild!.id, - voiceChannelId: memberVoiceChannel.id, - textChannelId: ctx.channel.id, - selfMute: false, - selfDeaf: true, - instaUpdateFiltersFix: true, - vcRegion: memberVoiceChannel.rtcRegion, - }) + if (!player) + player = client.manager.createPlayer({ + guildId: ctx.guild!.id, + voiceChannelId: memberVoiceChannel.id, + textChannelId: ctx.channel.id, + selfMute: false, + selfDeaf: true, + instaUpdateFiltersFix: true, + vcRegion: memberVoiceChannel.rtcRegion, + }); if (!player.connected) await player.connect(); - const response = await player.search({ query: query }, ctx.author) as SearchResult; + const response = (await player.search({ query: query }, ctx.author)) as SearchResult; const embed = this.client.embed(); if (!response || response.tracks?.length === 0) { @@ -73,7 +74,7 @@ export default class Play extends Command { } await player.queue.add(response.loadType === "playlist" ? response.tracks : response.tracks[0]); - + if (response.loadType === "playlist") { await ctx.editMessage({ content: "", @@ -87,9 +88,12 @@ export default class Play extends Command { await ctx.editMessage({ content: "", embeds: [ - embed - .setColor(this.client.color.main) - .setDescription(ctx.locale("cmd.play.added_to_queue", { title: response.tracks[0].info.title, uri: response.tracks[0].info.uri })), + embed.setColor(this.client.color.main).setDescription( + ctx.locale("cmd.play.added_to_queue", { + title: response.tracks[0].info.title, + uri: response.tracks[0].info.uri, + }), + ), ], }); } @@ -98,6 +102,10 @@ export default class Play extends Command { public async autocomplete(interaction: AutocompleteInteraction): Promise { const focusedValue = interaction.options.getFocused(); + if (!focusedValue) { + return; + } + const res = await this.client.manager.search(focusedValue, interaction.user); const songs = []; @@ -108,7 +116,7 @@ export default class Play extends Command { name: name.length > 100 ? `${name.substring(0, 97)}...` : name, value: track.info.uri, }); - }) + }); } return await interaction.respond(songs).catch(console.error); diff --git a/src/commands/music/PlayNext.ts b/src/commands/music/PlayNext.ts index 3760db687..3f79cb7a1 100644 --- a/src/commands/music/PlayNext.ts +++ b/src/commands/music/PlayNext.ts @@ -1,6 +1,6 @@ import type { AutocompleteInteraction, VoiceChannel } from "discord.js"; -import { Command, type Context, type Lavamusic } from "../../structures/index"; import type { SearchResult } from "lavalink-client/dist/types"; +import { Command, type Context, type Lavamusic } from "../../structures/index"; export default class PlayNext extends Command { constructor(client: Lavamusic) { @@ -48,22 +48,23 @@ export default class PlayNext extends Command { public async run(client: Lavamusic, ctx: Context, args: string[]): Promise { const query = args.join(" "); let player = client.manager.getPlayer(ctx.guild!.id); - const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel + const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel; - if (!player) player = client.manager.createPlayer({ - guildId: ctx.guild!.id, - voiceChannelId: memberVoiceChannel.id, - textChannelId: ctx.channel.id, - selfMute: false, - selfDeaf: true, - instaUpdateFiltersFix: true, - vcRegion: memberVoiceChannel.rtcRegion, - }) + if (!player) + player = client.manager.createPlayer({ + guildId: ctx.guild!.id, + voiceChannelId: memberVoiceChannel.id, + textChannelId: ctx.channel.id, + selfMute: false, + selfDeaf: true, + instaUpdateFiltersFix: true, + vcRegion: memberVoiceChannel.rtcRegion, + }); if (!player.connected) await player.connect(); await ctx.sendDeferMessage(ctx.locale("cmd.playnext.loading")); - - const response = await player.search({ query: query }, ctx.author) as SearchResult; + + const response = (await player.search({ query: query }, ctx.author)) as SearchResult; const embed = this.client.embed(); if (!response || response.tracks?.length === 0) { @@ -87,18 +88,24 @@ export default class PlayNext extends Command { await ctx.editMessage({ content: "", embeds: [ - embed - .setColor(this.client.color.main) - .setDescription(ctx.locale("cmd.playnext.added_to_play_next", { title: response.tracks[0].info.title, uri: response.tracks[0].info.uri })), + embed.setColor(this.client.color.main).setDescription( + ctx.locale("cmd.playnext.added_to_play_next", { + title: response.tracks[0].info.title, + uri: response.tracks[0].info.uri, + }), + ), ], }); } if (!player.playing) await player.play({ paused: false }); - } public async autocomplete(interaction: AutocompleteInteraction): Promise { const focusedValue = interaction.options.getFocused(); + if (!focusedValue) { + return; + } + const res = await this.client.manager.search(focusedValue, interaction.user); const songs = []; @@ -109,7 +116,7 @@ export default class PlayNext extends Command { name: name.length > 100 ? `${name.substring(0, 97)}...` : name, value: track.info.uri, }); - }) + }); } return await interaction.respond(songs).catch(console.error); diff --git a/src/commands/music/Search.ts b/src/commands/music/Search.ts index 58c8cd133..6b83801da 100644 --- a/src/commands/music/Search.ts +++ b/src/commands/music/Search.ts @@ -1,6 +1,6 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, type VoiceChannel } from "discord.js"; -import { Command, type Context, type Lavamusic } from "../../structures/index"; import type { SearchResult, Track } from "lavalink-client/dist/types"; +import { Command, type Context, type Lavamusic } from "../../structures/index"; export default class Search extends Command { constructor(client: Lavamusic) { @@ -43,19 +43,20 @@ export default class Search extends Command { const embed = this.client.embed().setColor(this.client.color.main); let player = client.manager.getPlayer(ctx.guild!.id); const query = args.join(" "); - const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel + const memberVoiceChannel = (ctx.member as any).voice.channel as VoiceChannel; - if (!player) player = client.manager.createPlayer({ - guildId: ctx.guild!.id, - voiceChannelId: memberVoiceChannel.id, - textChannelId: ctx.channel.id, - selfMute: false, - selfDeaf: true, - instaUpdateFiltersFix: true, - vcRegion: memberVoiceChannel.rtcRegion, - }) + if (!player) + player = client.manager.createPlayer({ + guildId: ctx.guild!.id, + voiceChannelId: memberVoiceChannel.id, + textChannelId: ctx.channel.id, + selfMute: false, + selfDeaf: true, + instaUpdateFiltersFix: true, + vcRegion: memberVoiceChannel.rtcRegion, + }); if (!player.connected) await player.connect(); - const response = await player.search({ query: query }, ctx.author) as SearchResult; + const response = (await player.search({ query: query }, ctx.author)) as SearchResult; if (!response || response.tracks?.length === 0) { return await ctx.sendMessage({ embeds: [embed.setDescription(ctx.locale("cmd.search.errors.no_results")).setColor(this.client.color.red)], diff --git a/src/commands/music/Shuffle.ts b/src/commands/music/Shuffle.ts index 17322314d..b15c4fbec 100644 --- a/src/commands/music/Shuffle.ts +++ b/src/commands/music/Shuffle.ts @@ -38,7 +38,7 @@ export default class Shuffle extends Command { embeds: [embed.setColor(this.client.color.red).setDescription(ctx.locale("player.errors.no_song"))], }); } - player.queue.shuffle() + player.queue.shuffle(); return await ctx.sendMessage({ embeds: [embed.setColor(this.client.color.main).setDescription(ctx.locale("cmd.shuffle.messages.shuffled"))], }); diff --git a/src/commands/music/Stop.ts b/src/commands/music/Stop.ts index 136eee07d..f3daabdde 100644 --- a/src/commands/music/Stop.ts +++ b/src/commands/music/Stop.ts @@ -34,7 +34,7 @@ export default class Stop extends Command { const player = client.manager.getPlayer(ctx.guild!.id); const embed = this.client.embed(); - player.stopPlaying(true, false) + player.stopPlaying(true, false); return await ctx.sendMessage({ embeds: [embed.setColor(this.client.color.main).setDescription(ctx.locale("cmd.stop.messages.stopped"))], diff --git a/src/commands/playlist/Load.ts b/src/commands/playlist/Load.ts index f273f007e..d6e44a524 100644 --- a/src/commands/playlist/Load.ts +++ b/src/commands/playlist/Load.ts @@ -76,7 +76,7 @@ export default class LoadPlaylist extends Command { selfDeaf: true, instaUpdateFiltersFix: true, vcRegion: member.voice.channel.rtcRegion, - }) + }); if (!player.connected) await player.connect(); } diff --git a/src/database/server.ts b/src/database/server.ts index a04241fcc..c84a7bc2f 100644 --- a/src/database/server.ts +++ b/src/database/server.ts @@ -202,7 +202,7 @@ export default class ServerData { }, }); } else { - throw new Error('Existing tracks are not in an array format.'); + throw new Error("Existing tracks are not in an array format."); } } else { // If no playlist exists, create a new one with the provided tracks diff --git a/src/env.ts b/src/env.ts index 21a0599b2..bb4bade5b 100644 --- a/src/env.ts +++ b/src/env.ts @@ -139,3 +139,14 @@ for (const key in env) { throw new Error(`Missing env variable: ${key}`); } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/events/client/ChannelDelete.ts b/src/events/client/ChannelDelete.ts index 5363b007b..5b8d42645 100644 --- a/src/events/client/ChannelDelete.ts +++ b/src/events/client/ChannelDelete.ts @@ -35,3 +35,14 @@ export default class ChannelDelete extends Event { } } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/events/client/VoiceStateUpdate.ts b/src/events/client/VoiceStateUpdate.ts index b5af8c3d7..d8ef24c09 100644 --- a/src/events/client/VoiceStateUpdate.ts +++ b/src/events/client/VoiceStateUpdate.ts @@ -57,7 +57,6 @@ export default class VoiceStateUpdate extends Event { if (vc.members instanceof Map && [...vc.members.values()].filter((x: GuildMember) => !x.user.bot).length <= 0) { setTimeout(async () => { - if (!player?.voiceChannelId) return; const playerVoiceChannel = newState.guild.channels.cache.get(player?.voiceChannelId); diff --git a/src/events/node/Connect.ts b/src/events/node/Connect.ts index 303ae8040..201cf77bc 100644 --- a/src/events/node/Connect.ts +++ b/src/events/node/Connect.ts @@ -52,3 +52,14 @@ export default class Connect extends Event { BotLog.send(this.client, `Node ${node.id} is ready!`, "success"); } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/events/node/Destroy.ts b/src/events/node/Destroy.ts index 768d6f67a..3b5843ccc 100644 --- a/src/events/node/Destroy.ts +++ b/src/events/node/Destroy.ts @@ -14,3 +14,14 @@ export default class Destroy extends Event { BotLog.send(this.client, `Node ${node.id} is destroyed: ${destroyReason}`, "warn"); } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/events/player/QueueEnd.ts b/src/events/player/QueueEnd.ts index 6e009098f..c25e808f2 100644 --- a/src/events/player/QueueEnd.ts +++ b/src/events/player/QueueEnd.ts @@ -1,6 +1,6 @@ +import type { TextChannel } from "discord.js"; import type { Player, Track, TrackStartEvent } from "lavalink-client"; import { Event, type Lavamusic } from "../../structures/index"; -import type { TextChannel } from "discord.js"; // queueEnd export default class QueueEnd extends Event { @@ -24,7 +24,18 @@ export default class QueueEnd extends Event { if (!message) return; if (message.editable) { - await message.edit({components: []}).catch(() => {}); + await message.edit({ components: [] }).catch(() => {}); } } -} \ No newline at end of file +} + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/events/player/TrackEnd.ts b/src/events/player/TrackEnd.ts index 7462c2d5b..ddfd07469 100644 --- a/src/events/player/TrackEnd.ts +++ b/src/events/player/TrackEnd.ts @@ -1,6 +1,6 @@ +import type { TextChannel } from "discord.js"; import type { Player, Track, TrackStartEvent } from "lavalink-client"; import { Event, type Lavamusic } from "../../structures/index"; -import type { TextChannel } from "discord.js"; export default class TrackEnd extends Event { constructor(client: Lavamusic, file: string) { @@ -19,9 +19,20 @@ export default class TrackEnd 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; - message.delete().catch(() => { }); + message.delete().catch(() => {}); } -} \ No newline at end of file +} + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/shard.ts b/src/shard.ts index 3b8a44d48..6de012e55 100644 --- a/src/shard.ts +++ b/src/shard.ts @@ -20,3 +20,14 @@ export async function shardStart(logger: Logger) { logger.start(`[CLIENT] ${manager.totalShards} shard(s) spawned.`); } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/structures/LavalinkClient.ts b/src/structures/LavalinkClient.ts index 6e2bc3c2b..6e323306f 100644 --- a/src/structures/LavalinkClient.ts +++ b/src/structures/LavalinkClient.ts @@ -38,3 +38,14 @@ export default class LavalinkClient extends LavalinkManager { return result; } } + +/** + * Project: lavamusic + * Author: Appu + * Main Contributor: LucasB25 + * Company: Coders + * Copyright (c) 2024. All rights reserved. + * 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 + */ diff --git a/src/structures/Lavamusic.ts b/src/structures/Lavamusic.ts index 470453c51..2e9742def 100644 --- a/src/structures/Lavamusic.ts +++ b/src/structures/Lavamusic.ts @@ -16,13 +16,13 @@ import { import { Locale } from "discord.js"; import config from "../config"; import ServerData from "../database/server"; +import { env } from "../env"; import loadPlugins from "../plugin/index"; import { Utils } from "../utils/Utils"; import { T, i18n, initI18n, localization } from "./I18n"; +import LavalinkClient from "./LavalinkClient"; import Logger from "./Logger"; import type { Command } from "./index"; -import { env } from "../env"; -import LavalinkClient from "./LavalinkClient"; export default class Lavamusic extends Client { public commands: Collection = new Collection(); @@ -35,7 +35,7 @@ export default class Lavamusic extends Client { public readonly color = config.color; private body: RESTPostAPIChatInputApplicationCommandsJSONBody[] = []; public topGG!: Api; - public utils = Utils;; + public utils = Utils; public env: typeof env = env; public manager: LavalinkClient; public embed(): EmbedBuilder { diff --git a/src/utils/Buttons.ts b/src/utils/Buttons.ts index aff4d8b17..7c1b1472a 100644 --- a/src/utils/Buttons.ts +++ b/src/utils/Buttons.ts @@ -1,6 +1,6 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, type EmojiIdentifierResolvable } from "discord.js"; -import type { Lavamusic } from "../structures/index"; import type { Player } from "lavalink-client/dist/types"; +import type { Lavamusic } from "../structures/index"; function getButtons(player: Player, client: Lavamusic): ActionRowBuilder[] { const buttonData = [ @@ -74,3 +74,14 @@ function getButtons(player: Player, client: Lavamusic): ActionRowBuilder