这是我的代码rn:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix="-")
@client.event
async def on_ready():
print('BOT ACTIVATED')
@client.command()
async def hello(ctx):
await ctx.send("hei this is a test just dont mind me")
@client.command()
async def join(ctx):
channel = ctx.message.author.voice.channel
await channel.connect()
client.run('mytoken')
我如何使该语音通道中的所有人静音?
答案 0 :(得分:2)
遍历语音通道的所有成员,并将mute=True
传递给edit
函数。
@client.command()
async def vcmute(ctx):
vc = ctx.author.voice.channel
for member in vc.members:
await member.edit(mute=True)