所以基本上这是我为我的服务器创建的一个lootbox,它应该自动删除。但当我醒来时,我会检查我的频道,看到4-5个消息,而不是1个!有什么帮助吗?- edit -我应该提一下,当我使x= 30分钟,删除时间为29分钟时,这很好用。
x = 180
@tasks.loop(minutes=x)
async def send():
open('acceptloot.txt', 'w').close()
response = "Frag has sent supplies into the field, if you're lucky you can get some!"
channel = bot.get_channel(903563274807808040)
await channel.send(file=discord.File('lootbox.png'), delete_after=10650)
message = await channel.send(response, delete_after=10750)
await message.add_reaction('✅')
@send.before_loop
async def before():
await bot.wait_until_ready()
send.start()发布于 2021-11-02 10:55:48
你可以尝试老方法,不需要"delete_after=":
message = 'your message' # your message
msg = await bot.send(message) # sends message
await asyncio.sleep(5) # wait 5 seconds
await msg.delete() # delete the messagehttps://stackoverflow.com/questions/69809087
复制相似问题