soup
DIAdiscord.js - Imagine an app
•Created by soup on 5/26/2024 in #djs-voice
bot stuck in signalling state
trying to set up a music bot - cant get it to join my VC
djs 14.15.2
/voice 0.17.0
Intents seem correct:
./commands/play.js file:
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
require('dotenv').config()
const token = process.env.BOT_TOKEN;
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
],
});
...
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
require('dotenv').config()
const token = process.env.BOT_TOKEN;
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
],
});
...
async function playSong(interaction, url) {
const guild = interaction.member.guild;
const member = guild.members.cache.get(interaction.member.user.id);
const voiceChannel = member.voice.channel;
if (!voiceChannel) {
return interaction.reply('join vc first');
}
const connection = joinVoiceChannel({
channelID: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
console.log(connection);
console.log('ppl in vc: ', voiceChannel.members);
...
async function playSong(interaction, url) {
const guild = interaction.member.guild;
const member = guild.members.cache.get(interaction.member.user.id);
const voiceChannel = member.voice.channel;
if (!voiceChannel) {
return interaction.reply('join vc first');
}
const connection = joinVoiceChannel({
channelID: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
console.log(connection);
console.log('ppl in vc: ', voiceChannel.members);
...
6 replies