© 2026 Hedgehog Software, LLC
const { joinVoiceChannel, createAudioPlayer, createAudioResource, StreamType } = require("@discordjs/voice") const { join } = require("node:path") module.exports.run = async (message, client) => { const resource = createAudioResource(join(__dirname, "pregame.wav"), { inputType: StreamType.WebmOpus }) const connection = joinVoiceChannel({ channelId: client.channelId, guildId: message.guild.id, adapterCreator: message.guild.voiceAdapterCreator }) const player = createAudioPlayer() player.play(resource) connection.subscribe(player) }
console.log
const intents = [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMessages]
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