在我的不和諧服務(wù)器上,如果您加入名為“加入”以創(chuàng)建頻道的語音頻道,我希望我的機器人創(chuàng)建一個名為“f'{member}s頻道”的語音頻道,然后自動將人員移入該頻道。我可以使用等待克?。Q,原因)讓機器人建立頻道,但由于某種原因我無法讓機器人將成員移入語音頻道。這就是我現(xiàn)在所擁有的:import discordimport datetimeclient = discord.Client()@client.eventasync def on_voice_state_update(member, before, after):? ? if str(after.channel) == 'Join to create channel':? ? ? ? if str(after) != str(before):? ? ? ? ? ? await after.channel.clone(name=f'{member}s channel')? ? ? ? ? ? person_to_move = member? ? ? ? ? ? channel_to_move_person_to_move_to = client.get_channel(f'{member}s channel')? ? ? ? ? ? await client.move_member(person_to_move, channel_to_move_person_to_move_to)每當(dāng)我運行此代碼時,我都會收到一個 AttributeError 消息,指出“Client”沒有屬性“move_member” move_member 是我每次搜索答案時在 Stack Overflow 上看到的內(nèi)容。本來我有:await move_to(person_to_move, channel_to_move_person_to_move_to)這是我在 discord py API 文檔中找到的。然而,那里的錯誤是它給了我一個 NameError 說“move_to”未定義。任何信息都會有幫助。我錯過了一件小事還是我做的完全錯誤?謝謝。
將成員移動到語音頻道discord.py
慕田峪9158850
2023-07-11 14:52:57