我正在尝试创建一个不和谐的机器人,它能够在机器人被调用时将某个用户静音,比如“,mute @”。该命令应将muted角色添加到用户,以便他们无法发送消息。client.event print(f'{client.user} has connected to Discord and is ready to mute@client.command(aliases=[',mute'])
async def <em
async def mute(ctx, user: discord.User,time,*,reason): await ctx.message.delete() role = discord.utils.get(ctx.guild.rolesf"Can't remove the role {i}")
我想知道如何让我的静音命令在一段时间内使某人静音。例如,p/mute @User 1h会将某人静音1小时。@client.command()async def mute(ctx, member : discord.Member= None): await ctx.send("Please mention a user to mute")
else
因此,我执行了一个mute命令,但是当输入"%unmute @user“时,我不知道要采取什么步骤来删除"Muted”角色。以下是mute命令的代码: @commands.has_permissions(manage_messages=True)
@bot.command(name='mute', help='Use %helpmute to see full description...Require