javascript - voiceStateUpdate 事件不做任何事情
问题描述
自 discord.js 的 v13 更新以来我遇到了一个问题。我可以记录通道(oldState、newState),但代码没有执行并且没有返回错误!
这是我的代码:
client.on('voiceStateUpdate', async (oldState, newState) => {
console.log(oldState) //I got the channel on the console
//But the lines below not work at all since the v13 update
if(oldState.channelID == '825407723129536543') {
console.log(`old state is > ${oldState.channelID}`)
if(oldState.channel.members.size == 0) {
oldChannel = client.channels.cache.find(c => c.name == "test")
client.channels.cache.find(c => c.name == "test").clone(undefined, true, false, 'Needed a clone')
.then(oldChannel.delete())
}
}
});
解决方案
推荐阅读
- spring - `requestBodyAndHeaders` 的替代方案
- php - 为数组的键和值对提供自定义名称
- r - 文本挖掘 - 没有 `tm` 包的词干提取方法
- python-3.x - 如何检查数字奇偶python?
- angular - 如何以角度反应形式使用指令
- python - 多次重定向到抓取网站后如何登录?
- javascript - 本地存储不存储 URL
- html - Safari 10 中的按钮没有包裹和溢出容器(在 Edge 和 Chrome 中很好)
- selenium - 为什么我应该使用 CSS 选择器而不是 XPath 进行自动化测试?
- android - RecyclerView - 当我只想更新 1 个视图时更新 2 个视图