javascript - 如何获取我刚刚在 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; // <--
解决方案
推荐阅读
- c++ - 没有灰色重叠的否定图像
- r - 使用 github API 时如何指定用户代理?
- javascript - 如何制作正则表达式来过滤 URL 模式,使其在 8 个字符通配符和目录斜杠之后终止?
- html - 如何启用在页面加载时选中的第一个复选框并仅显示数据目标 div 并隐藏其他数据,并且一次仅选中一个复选框
- node.js - 无法通过 WebDAV 使用 MS Word 保存 .doc 文件 - 未发送 PUT 请求
- ios - CloudKit:传入的CKNotification反复推送
- node.js - 如何正确读取 philips hue 返回的对象
- kubernetes - 在 kubernetes pod 中访问 Nexus 存储库管理器密码
- python - 超过时间/内存限制时Docker linux终止进程脚本
- linux - 当在字符串中作为 eval 的参数传递时,for 循环不起作用