简体   繁体   中英

Discord.py | Delete empty voice channels

I'm making a bot for my discord server and I'm having trouble. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM