Initialize player in correct spot
This commit is contained in:
parent
3559431e2b
commit
2f0e54eb81
2 changed files with 10 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -130,3 +130,4 @@ dist
|
|||
.pnp.*
|
||||
lavalink/
|
||||
Lavalink.jar
|
||||
settings.json
|
||||
20
src/index.ts
20
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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue