How to edit a message in discord.py

前端 未结 2 1356
感情败类
感情败类 2021-01-14 00:53

I would like to have my bot edit a message if it detects a keyword, i\'m not sure how to edit the message though.

I\'ve looked through the documentation but can\'t s

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-14 01:34

    Here's a solution that worked for me.

    @client.command()
    async def test(ctx):
      message = await ctx.send("hello")
      await asyncio.sleep(1)
      await message.edit(content="newcontent")
    

提交回复
热议问题