您如何检测语音通道流? (discord.js)

时间:2020-06-18 16:02:46

标签: discord.js

当用户直接在语音通道中进行流媒体播放时,会发生任何事件吗?

1 个答案:

答案 0 :(得分:0)

client.on("voiceStateUpdate", (oldVoiceState, newVoiceState) => {
    if (!newVoiceState) {return false};
    if (newVoiceState.streaming) {
        console.log(`${newVoiceState.member.user.tag} is streaming.`);
    };
});

https://discord.js.org/#/docs/main/stable/class/VoiceState