有没有一种方法可以让机器人对用户的消息命令做出反应?
Is there a way that the bot can add a reaction to a user's message command?
@commands.has_permissions(manage_messages=True)
@commands.command(name='clear', aliases=['clean', 'cleanup'])
async def clear(self, ctx, limit: int = 10) -> None:
messages = await ctx.channel.purge(bulk=True, limit=limit)
embed=discord.Embed(title=f"`{len(messages)}` mensagens deletadas com sucesso", color=COR_PRINCIPAL)
embed.set_author(name="Plugin de comandos do Tatrantolo",icon_url=ICONE)
await ctx.send(embed=embed, delete_after=5)
我希望机器人添加一个反应,可能是一个 ckeck 表情符号到用户的命令,显示命令已收到。提前致谢!
您可能需要在主缩进中的命令结束之前添加它。
await ctx.message.add_reaction("✅")
@commands.has_permissions(manage_messages=True)
@commands.command(name='clear', aliases=['clean', 'cleanup'])
async def clear(self, ctx, limit: int = 10) -> None:
messages = await ctx.channel.purge(bulk=True, limit=limit)
embed=discord.Embed(title=f"`{len(messages)}` mensagens deletadas com sucesso", color=COR_PRINCIPAL)
embed.set_author(name="Plugin de comandos do Tatrantolo",icon_url=ICONE)
await ctx.send(embed=embed, delete_after=5)
我希望机器人添加一个反应,可能是一个 ckeck 表情符号到用户的命令,显示命令已收到。提前致谢!
您可能需要在主缩进中的命令结束之前添加它。
await ctx.message.add_reaction("✅")