最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

我如何让我的漫游器创建克隆另一个语音通道?

运维笔记admin17浏览0评论

我如何让我的漫游器创建/克隆另一个语音通道?

我如何让我的漫游器创建/克隆另一个语音通道?

我希望我的机器人创建一个新的语音服务器,或者只是克隆另一个。 “ voic”是包含语音通道ID的var。

voic.voiceChannel.clone(undefined, true, false, 'Needed a clone')
                           // discord example
            .then(clone => console.log(`Cloned ${channel.name} to make a channel called ${clone.name}`))
            .catch(console.error);
          }

TypeError: Cannot read property 'clone' of undefined.
回答如下:

由于voic本身是一个ID,因此您需要通过其ID获取频道。您可以使用bot.channels.get()检索频道。

var bot = new Discord.Client();

bot.on('ready', () => {
  bot.channels.get(voic).clone(undefined, true, false, 'Needed a clone')
    .then(clone => console.log(`Cloned ${channel.name} to make a channel called ${clone.name}`))
    .catch(console.error);
}
发布评论

评论列表(0)

  1. 暂无评论