【发布时间】:2021-07-06 03:49:47
【问题描述】:
我最近创建了一个播放广播的不和谐机器人,我想知道如何确保当没有人时,机器人会引导它。
if (oldState.channelID !== oldState.guild.me.voice.channelID || newState.channel)
return;
// otherwise, check how many people are in the channel now
if (!oldState.channel.members.size === 1)
setTimeout(() => { // if 1 (you), wait five minutes
if (!oldState.channel.members.size === 1) // if there's still 1 member,
oldState.channel.leave(); // leave
}, 10);
});
我对此进行了测试,但它不起作用,有人可以帮助我吗?谢谢!
【问题讨论】:
标签: discord discord.js bots radio