From af9bf673236ad24eb6f462f2dc8286a1980f2531 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Mon, 22 Jun 2020 02:06:48 +0100 Subject: [PATCH] Moved ~remindme command to FunCommands.py --- cogs/FunCommands.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index 5271cdb1..ebe8fa6f 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -186,6 +186,24 @@ class Fun(commands.Cog): # Delete the message sent instantly await ctx.message.delete() + # ~remindme command to allow the bot to dm you to remind you of something + @commands.command(aliases=["remindme", "rm"]) + async def remind_me(self, ctx, time=None, *, text): + # Grab the author and store it in "author" + author = ctx.author + + # If a value for time as been given + if time: + # Sleep the thread for the amount of time specified by the user + await asyncio.sleep(float(time)) + # Send message to user's dms + await author.send(text) + + # else no time has been given + else: + # Instantly Send message to user's dms + await author.send(text) + def setup(bot): bot.add_cog(Fun(bot))