如何对Webhook发送的消息添加反应?

时间:2020-02-17 21:23:42

标签: python python-3.x discord discord.py discord.py-rewrite

我想对Webhook发送的消息添加反应,但是idk如何做到这一点,这是我的代码:

    async with aiohttp.ClientSession() as session:
        webhook = Webhook.from_url('url', adapter=AsyncWebhookAdapter(session))
        embed = discord.Embed(color=color)
        caractère = ["(", "'", ")", ","]
        for caractère in caractère:
            args = str(args).replace(caractère, "")
        embed.add_field(name="Nouvelle suggestion !", value=str(args).strip(""))
        embed.set_footer(text=f"""{ctx.message.author} • {datetime.now().strftime("%d %b %Y %H:%M:%S")}""",
                         icon_url=str(ctx.message.author.avatar_url))
        message = await webhook.send(embed=embed, username=ctx.author.name, avatar_url=ctx.author.avatar_url)```

1 个答案:

答案 0 :(得分:0)

这是我的操作方式,发送嵌入信息后,我会这样做

reactions = "\U0001f44d"
reactions2 = "\U0001f44e"
await application.add_reaction(reactions)
await application.add_reaction(reactions2)

应用程序是我嵌入的名称,您需要将其更改为您自己命名的名称。 您也可以导入表情符号,然后执行:thumbup:或您要执行的任何反应。