© 2026 Hedgehog Software, LLC
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); ...
Join the Discord to ask follow-up questions and connect with the community
Support server for discord.js, a Node.js module to interact with Discord's apps API.
57,666 Members