【问题标题】:Trying to mute an entire voice channel with Discord.py尝试使用 Discord.py 使整个语音通道静音
【发布时间】:2021-01-31 19:59:10
【问题描述】:

我对 python 很陌生,搜索了https://discordpy.readthedocs.io/en/latest/ 并没有找到任何类似的选项。 有人可以为我写一个代码吗? 这就是我所做的:

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix = '.')

@bot.event
async def on_ready():
    print('The bot is ready!')

bot.run('TOKEN')

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    我的处理方法是生成该语音通道中所有用户的列表,然后通过 for 循环将每个用户静音。

    channel.members 将返回语音频道中所有成员的列表 (https://discordpy.readthedocs.io/en/latest/api.html?highlight=channel%20members#discord.VoiceChannel.members)

    【讨论】:

      猜你喜欢
      • 2023-03-28
      • 2019-09-18
      • 1970-01-01
      • 2021-08-26
      • 2021-04-15
      • 2021-01-07
      • 2020-06-15
      • 2020-09-24
      • 2021-11-13
      相关资源
      最近更新 更多