这是代码的一部分:
async def on_voice_state_update(self,member,before,after):
channel = (800674042247118878)
if before.self.deaf and after.self_deaf:
member.move_to = channel
这就是我得到的错误
File "C:\Users\nikos\Desktop\Koimisas\koimisas.py", line 14, in on_voice_state_update
if before.self.deaf and after.self_deaf:
AttributeError: 'VoiceState' object has no attribute 'self'
答案 0 :(得分:0)
您需要检查after.deaf
async def on_voice_state_update(self,member,before,after):
channel = self.bot.get_channel(800674042247118878)
if after.deaf and after.channel:
await member.move_to(channel)