【发布时间】:2021-03-01 07:38:55
【问题描述】:
我想通过另一个命令创建一个编辑机器人旧消息的命令,例如:
user: !cmds
bot: *commands list*
user: !next
bot: *edits old message into a new one*
我自己尝试了很多次,但总是失败,谁能帮帮我?
我是如何做到的:
@client.command
async def test():
embed=discord.Embed(title="Page1")
await ctx.send(embed=embed)
@client.event
async def on_command(message):
embed2=discord.Embed(title="Page2")
await client.process_commands(message)
if message.content == '$next':
await message.edit(content=embed2)
【问题讨论】:
-
请添加minimal, reproducible example,如果我们为其他人编写代码,那么这不是一个网站
-
好吧,对不起,我试着让它变成这样:
@client.command async def test(): embed=discord.Embed(title="Page1") await ctx.send(embed=embed) @client.event async def on_command(message): embed2=discord.Embed(title="Page2") await client.process_commands(message) if message.content == '$next': await message.edit(content=embed2)
标签: discord.py message editing