Zach
Zach
DIAdiscord.js - Imagine an app
Created by Zach on 8/10/2023 in #djs-voice
using commands not working
I created a bot and have been using -join to join voice channels. I wanted to work on making it using a /join command. I got the command to work to join it to a voice channel but I can't get it to play music when it's in there. Do I need to send back some sort of info to get the bot to play music from my index.js. thanks for any help.
3 replies
DIAdiscord.js - Imagine an app
Created by Zach on 7/18/2023 in #djs-questions
Discord Voice Bot
I'm new to setting up discord bots and have been working on some small functions. Just trying to learn how things work. I am wanting to get my bot to join a discord voice channel and i have searched in multiple different places and tried what others have reccomended but I can't get my bot to join a voice channel. I was using what the discord.js website said to use. But I have so far been unable to get it to even join a channel, let alone play a sound. "dependencies": { "@discordjs/builders": "^1.6.3", "@discordjs/opus": "^0.9.0", "@discordjs/rest": "^1.7.1", "@discordjs/voice": "^0.16.0", "discord-api-types": "^0.37.48", "discord-player": "^6.6.1", "discord.js": "^14.11.0", "dotenv": "^16.3.1", "libsodium-wrappers": "^0.7.11" } I've tried installing several different dependencies The https://discordjs.guide/voice/voice-connections.html#cheat-sheet Says to use : const connection = joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id, adapterCreator: channel.guild.voiceAdapterCreator, }); With this I get an error about channel. I've tried putting in the actual channel ids and still couldnlt get it to work. I've seen several people talk about using "connectToChannel(channel)" but i get an error about connectToChannel is undefined. Any help at all or if you send me a place that can explain it to me, I would appreciate it. Thanks
9 replies