我想删除一个类别的所有频道被用户删除的不一致,使用python。我刚刚找到了这个函数on_guild_channel_delete(频道),但它不能像我想要的那样工作,因为频道是在类别被删除后找到的。
提前谢谢。
发布于 2020-09-26 19:33:16
如果你要在你自己的服务器上使用机器人,如果你的所有频道都属于任何类别,你可以这样使用:
@client.event
async def on_guild_channel_delete(channel):
for chn in channel.guild.channels:
if not chn.category and not isinstance(chn, discord.channel.CategoryChannel):
await i.delete()这样,当一个类别或频道被删除时,它将删除所有没有类别的频道。这不是一个完美的解决方案,但据我所知,这是唯一的方法。
https://stackoverflow.com/questions/64076425
复制相似问题