【发布时间】:2022-01-20 19:30:39
【问题描述】:
我制作了一个不和谐机器人,它通过命令将人员添加到队列中,然后显示队列。我不希望频道填满未完成的队列。所以我希望机器人删除自己的消息。
例子:
用户说:!dips
机器人说:1. 用户#这是消息 1。
另一个用户说:!dips
Bot 说:1. 用户,2. 另一个用户。 #这是消息 2。
机器人现在删除消息 1。由于消息 2 中的信息相同,因此不再需要它。
这是我正在使用的 python 代码。
@client.event
async def on_message(message):
if message.content.lower() in list_of_commands:
await message.channel.send(queue(arg1,arg2,arg3))
#After sending new message here, it should delete the old message.
【问题讨论】:
标签: python discord discord.py bots