【发布时间】:2021-12-21 03:38:00
【问题描述】:
@bot.event
async def on_voice_state_update(member, before, after):
if before.channel is None and after.channel is not None:
await member.guild.system_channel.send(
"{} into the voice room".format(member.nick)
)
channel = await member.guild.create_text_channel('123')
if before.channel is not None and after.channel is None:
await member.guild.system_channel.send(
"{} out of the voice room".format(member.nick)
)
channel = await member.guild.delete_text_channel('123')
当我进入语音频道时,机器人会创建一个文本频道 如果我离开了语音频道,机器人应该删除 文字频道
但是当我出去的时候,bot 并没有删除频道 如何修复此代码?
【问题讨论】:
标签: python api discord discord.py