diff --git a/.gitignore b/.gitignore index 858c98f..b742063 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,5 @@ dist .yarn/install-state.gz .pnp.* lavalink/ -Lavalink.jar \ No newline at end of file +Lavalink.jar +settings.json \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index d6b90af..83f0c55 100644 --- a/src/index.ts +++ b/src/index.ts @@ -164,12 +164,7 @@ client.on("messageCreate", async (msg: Message) => { if (msg.guildId && msg.channelId) { if (!settings.requestChannels[msg.guildId]) { await msg.delete(); - const player = await kazagumo.createPlayer({ - guildId: msg.guild.id, - textId: msg.channel.id, - voiceId: msg.channel.id, - volume: 40, - }); + const play = new ButtonBuilder() .setCustomId("play") .setLabel("Play/Pause") @@ -280,6 +275,7 @@ client.on("messageCreate", async (msg: Message) => { } if (msg.channel.name === "moe-song-requests") { let controls; + if (!settings.requestChannels[msg.guild.id]) { let answer = await msg.reply("Use .init first"); console.log(answer); @@ -297,6 +293,12 @@ client.on("messageCreate", async (msg: Message) => { // get(requestChannels[msg.guild.id]); // client.channels.fetch(requestChannels[msg.guild.id]) } + const player = await kazagumo.createPlayer({ + guildId: msg.guild.id, + textId: msg.channel.id, + voiceId: msg.channel.id, + volume: 40, + }); const query = msg.content; const { channel } = msg.member.voice; @@ -309,12 +311,6 @@ client.on("messageCreate", async (msg: Message) => { return; } - const player = await kazagumo.createPlayer({ - guildId: msg.guild.id, - textId: msg.channel.id, - voiceId: channel.id, - volume: 40, - }); console.log("Player created"); const result = await kazagumo.search(query, { requester: msg.author }); if (!result.tracks.length) {