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)
}
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)
}