小智 6
这将通过代码完成。您需要以某种方式在您的机器人程序中执行它。例如,为其创建一个执行它的命令,然后您可以删除它。
channel = bot.get_channel(id_of_the_channel)
message = await channel.fetch_message(id_of_the_message)
# make sure that you change "id_of_the_channel" for the id of the channel (as an integer)
# and make sure to change "id_of_the_message" for the id of the message (as an integer)
# you can get those by enabling Developer Mode in the Appearance settings in discord
# and right-clicking on the channel to get its id, and right-clicking on the message to get
# its id as well.
Run Code Online (Sandbox Code Playgroud)
await message.edit(content="the new content of the message")
Run Code Online (Sandbox Code Playgroud)
基本上就是这样。通过您的机器人执行这三行代码,它将编辑消息。
| 归档时间: |
|
| 查看次数: |
23467 次 |
| 最近记录: |