【发布时间】:2021-12-16 21:39:12
【问题描述】:
所以基本上这是我为我的服务器制作的战利品箱,它应该自行删除.. 但是当我醒来时,我检查我的频道看到 4-5 条消息,而不是 1 条!有什么帮助吗? - 编辑 - 我应该提到当我让 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()
【问题讨论】:
标签: python python-3.x discord discord.py