Skip to content

Commit

Permalink
Fix ephemeral delete later
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 15, 2022
1 parent 8b4742c commit dc3315b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,10 @@ async def embed_reply(ctx, *, content="", title="", description="", fields=[], t
embed=embed_to_send,
**kwargs)
if ephemeral is not bool(ephemeral) and not getattr(ctx, "interaction", None):
await asyncio.sleep(ephemeral)
try:
async def delete_later():
await asyncio.sleep(ephemeral)
await getattr(ctx, "message", ctx).delete()
except Exception:
pass
asyncio.get_event_loop().create_task(delete_later())
return ret


Expand Down

0 comments on commit dc3315b

Please sign in to comment.