【问题标题】:Is it possible to mute users in a certain voice channel, not removing them from the channel in discord? (Python)是否可以将某个语音频道中的用户静音,而不是将他们从不和谐的频道中删除? (Python)
【发布时间】:2020-06-09 12:29:47
【问题描述】:

我正在尝试将某个语音频道中的用户静音,但没有为其创建“静音”角色。 这是我的代码:

await voiceChat.set_permissions(target=user, speak=False)

但它仅在用户重新加入频道时才有效。有没有办法让它在现场工作?

【问题讨论】:

  • 您不想设置权限。您想编辑成员静音/取消静音:discordpy.readthedocs.io/en/latest/… 要使用该命令,您需要相关权限。这将是他们无法撤消的服务器静音。所以请编写一个强大的逻辑来取消成员静音
  • 谢谢,现在知道了!现在它正在工作。

标签: python python-3.x discord discord.py


【解决方案1】:

https://discordpy.readthedocs.io/en/latest/api.html?highlight=discord%20utils#discord.Member.edit 您可以使用 .edit(mute = True) 将您需要的用户静音。

【讨论】:

    猜你喜欢
    • 2021-01-02
    • 2023-04-07
    • 1970-01-01
    • 2021-02-10
    • 2021-01-07
    • 1970-01-01
    • 2021-01-31
    • 2021-04-13
    • 2020-10-29
    相关资源
    最近更新 更多