首页 > 解决方案 > Discord.py“Za Warudo”机器人命令

问题描述

我正在制作一个机器人命令...

  1. 锁定频道;使任何人都无法发送消息。
  2. 发送图像和消息。
  3. 解锁通道前等待 10 秒,允许其他人发送图像。

但是,我尝试了不同的消息,例如更改角色名称和不同的睡眠时间,但机器人不会发送消息、修改命令或它打算做什么。只有这个命令不起作用,并且控制台中没有弹出错误。有人可以帮我吗?

@commands.has_permissions(manage_messages=True)
async def warudo(ctx):
    await ctx.channel.set_permissions(ctx.verified, send_messages=False)
    await ctx.send('***Za Warudo!***')
    
    await ctx.send(file=discord.File('https://pics.me.me/thumb_you-thought-it-was-an-emoji-but-it-was-me-71487398.png'))
    await ctx.send( ctx.channel.mention + "has paused.")

    await asyncio.sleep(10)
    await ctx.channel.set_permissions(ctx.verified, send_messages=True)```

标签: discorddiscord.py

解决方案


推荐阅读