我最近安装了 Discord.js 13.1.0,但我的音乐命令坏了,因为,显然,channel.join();
不是一个函数,尽管我已经在 12.5.3 上使用它几个月了......
有人知道解决这个问题吗?
我的加入命令的某些部分:
const { channel } = message.member.voice;
const voiceChannel = message.member.voice.channel;
await channel.join();
它会导致错误。
Discord.js 不再支持语音。您需要使用他们制作的其他包(@discordjs/声音)。您可以导入joinVoiceChannel
从那里。
//discord.js and client declaration
const { joinVoiceChannel } = require('@discordjs/voice');
client.on('messageCreate', message => {
if(message.content === '!join') {
joinVoiceChannel({
channelId: message.member.voice.channel.id,
guildId: message.guild.id,
adapterCreator: message.guild.voiceAdapterCreator
})
}
})
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)