How to edit a message in discord.py

前端 未结 2 1355
感情败类
感情败类 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:43

    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")
    

提交回复
热议问题