【问题标题】:Discord - How to update voice channel limit?Discord - 如何更新语音频道限制?
【发布时间】:2021-09-28 11:17:17
【问题描述】:

我是 Discord 机器人开发的新手。我想在现有语音通道上设置user_limit。我知道语音通道 id 我只想在那里更新限制。

【问题讨论】:

    标签: python discord


    【解决方案1】:

    没有指定特定的 Python 库,因此假定为 discord.py。


    首先,您需要通过 Client class 实例获取频道,如下所示:

    channel = client.get_channel(123)
    
    • “123”是频道ID,格式为int。

    该函数将返回适当类型的频道(或None),这意味着您可以通过VoiceChannel.edit 编辑VoiceChannel:

    await channel.edit(user_limit=2)
    

    完成了!如果需要 Discord 的 API 参考,可以查看in this site。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-04
      • 1970-01-01
      • 2020-11-03
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 2022-07-10
      • 2022-01-23
      相关资源
      最近更新 更多