From 8a4a50294d76470f602be3484dbb0e3886ef50ba Mon Sep 17 00:00:00 2001 From: rtk-rnjn Date: Sat, 9 Sep 2023 10:58:26 +0530 Subject: [PATCH] add delete message fun --- cogs/reminder/__init__.py | 3 ++- core/Parrot.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/reminder/__init__.py b/cogs/reminder/__init__.py index ffc76b67..21502930 100644 --- a/cogs/reminder/__init__.py +++ b/cogs/reminder/__init__.py @@ -76,7 +76,8 @@ async def notify_reminder_msg(self, ctx: Context, *, timestamp: int | float) -> ) embed = discord.Embed(description=_id, color=discord.Color.blurple()) try: - await ctx.author.send(msg, embed=embed, view=ctx.send_view()) + notify_message = await ctx.author.send(msg, embed=embed, view=ctx.send_view()) + await self.bot.wait_and_delete(message=notify_message, timestamp=timestamp) await ctx.tick() except discord.Forbidden: await ctx.reply(msg, embed=embed) diff --git a/core/Parrot.py b/core/Parrot.py index 0cc6ecf3..52aec2bd 100644 --- a/core/Parrot.py +++ b/core/Parrot.py @@ -1568,7 +1568,7 @@ async def wait_and_delete( self, *, delay: int | None = None, - timestamp: int | None = None, + timestamp: float | None = None, channel_id: int | None = None, message_id: int | None = None, message: discord.Message | None = None,