首页 > 解决方案 > 如何获取我刚刚在 discord.js 中创建的语音通道的 id?

问题描述

如何获取我刚刚创建的语音通道的 ID(如果可能,按名称)并将其放入变量中?前任:

var channelvoice = ('Name '+count); // name + var
client.channels.get(fun).clone(`${channelvoice}`, true, true, 'Needed a clone') // fun is a name of a channel.
            .then(clone => clone.setParent('629745940953678742'))
            .then(clone => clone.setPosition(1))
            .catch(console.error);
var idvoicechannel = client.channels.get(`${channelvoice}`).id; // <--

标签: javascriptnode.jsdiscorddiscord.js

解决方案


推荐阅读