例如,我想检测某人何时从“Talk I”变为“Talk II”。但它应该可以在同时不断开服务器的情况下工作,然后加入“Talk II”!有没有办法做到这一点??
1 回答
1
每次用户更新他们的语音状态时,客户端都会发出一个voiceStateUpdate事件。
要检测用户是否更改了他们的语音通道,您可以执行以下操作:
client.on('voiceStateUpdate', (oldMember, newMember) => {
let oldChannel = oldMember.voiceChannel, // the previous channel, if there was one
newChannel = newMember.voiceChannel; // the current channel, if there is one
if (oldChannel != newChannel) { // if the channel has changed
// do your stuff...
}
});
于 2018-10-14T15:51:11.710 回答