类型错误的暂停命令(TypeError in Pause Command)

2019-10-29 04:52发布

我拉着所有从我原来的僵尸我的命令交给我的机器人是由真实突击队的支持,但由于某些原因,我继续得到TypeError: Cannot read property 'get' of undefined

run(msg, ops) {
    let fetched = ops.active.get(msg.guild.id);

    const nonePlaying = new RichEmbed()
    .setColor(0xde2e43)
    .setTitle(':no_entry: No Music Playing')
    .setDescription('There currently isn\'t any music playing in this guild!')

    if (!fetched) return msg.channel.send(nonePlaying)

    const noChannel = new RichEmbed()
    .setColor(0xde2e43)
    .setTitle(':no_entry: Wrong Channel')
    .setDescription('You must be in the same channel as the bot to skip a song.')

    if (msg.member.voiceChannel !== msg.guild.me.voiceChannel) return msg.say(noChannel)

    const paused = new RichEmbed()
    .setColor(0xde2e43)
    .setTitle(':no_entry: Error')
    .setDescription('This music is already paused.')

    if (fetched.dispatcher.paused) return msg.channel.send(paused)

    fetched.dispatcher.pause();

    const pause = new RichEmbed()
    .setColor(0x36393f)
    .setTitle(':pause_button: Paused')
    .setDescription(`Successfully paused ${fetched.queue[0].songTitle}`)

    if (fetched.dispatcher.paused) return msg.channel.send(pause)
}

这是我使用目前的代码,并将它与我目前工作的机器人,只是没有用新我编码。

文章来源: TypeError in Pause Command