TypeError:无法读取null的属性“ end”

时间:2020-09-04 11:01:19

标签: javascript discord discord.js

我正在尝试对音乐机器人执行跳过命令,但出现此错误:

TypeError: Cannot read property 'end' of null

我的代码:

} else if (message.content.startsWith(`${prefix}skip`)) {
    if (!message.member.voice.channel) return message.channel.send(":speaking_head: **You need to be in a voice channel to use this command.**");
    if (!serverQueue) return message.channel.send(":warning: **There is nothing playing**");
    serverQueue.connection.dispatcher.end()
    message.channel.send("**Track skipped** :track_next:")
    return undefined
}

0 个答案:

没有答案