[英]Discord.py | Delete empty voice channels
I'm making a bot for my discord server and I'm having trouble.我正在为我的 Discord 服务器制作一个机器人,但遇到了麻烦。 What I want is when the last person leaves a voice channel (it had been generated by the bot), I want to delete the voice channel.
我想要的是当最后一个人离开语音通道(它是由机器人生成的)时,我想删除语音通道。
I've also thought about testing for any empty voice channels and deleting them, but I'm not sure how to do either one.我也考虑过测试任何空的语音频道并删除它们,但我不确定如何做任何一个。
您可以使用on_voice_state_update事件来测试成员何时离开语音频道,检查是否为空,然后VoiceChannel.delete
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.