本文介紹了是否可以將某個語音頻道中的用戶靜音,而不是將他們從不和諧的頻道中刪除?(Python)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在嘗試將某個語音頻道中的用戶靜音,但沒有為其創建靜音"角色.這是我的代碼:
I am trying to mute a user in a certain voice channel without creating a role "Muted" for it. Here is my code:
await voiceChat.set_permissions(target=user, speak=False)
但它僅在用戶重新加入頻道時才有效.有沒有辦法讓它在現場工作?
But it works only when the user is rejoining the channel. Is there a way to make it work live?
推薦答案
https://discordpy.readthedocs.io/en/latest/api.html?highlight=discord%20utils#discord.Member.edit您可以使用 .edit(mute = True) 將您需要的用戶靜音.
https://discordpy.readthedocs.io/en/latest/api.html?highlight=discord%20utils#discord.Member.edit You can use .edit(mute = True) to mute a user you need.
這篇關于是否可以將某個語音頻道中的用戶靜音,而不是將他們從不和諧的頻道中刪除?(Python)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!