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
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")
You can use the Message.edit coroutine. The arguments must be passed as keyword arguments content
, embed
, or delete_after
. You may only edit messages that you have sent.
await message.edit(content="newcontent")