From 76e954682eab2e8ac5fff05f220b8619045f3172 Mon Sep 17 00:00:00 2001 From: flifloo Date: Wed, 27 May 2020 00:25:59 +0200 Subject: [PATCH] Add reminder list and fix reminder loop --- extensions/reminders.py | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/extensions/reminders.py b/extensions/reminders.py index af0d822..1fb2129 100644 --- a/extensions/reminders.py +++ b/extensions/reminders.py @@ -1,3 +1,4 @@ +import asyncio import re from datetime import datetime, timedelta @@ -13,10 +14,6 @@ extension_name = "reminders" logger = logger.getChild(extension_name) -async def reminder_exec(coro): - await coro - - def time_pars(s: str) -> timedelta: match = re.fullmatch(r"(?:([0-9]+)W)*(?:([0-9]+)D)*(?:([0-9]+)H)*(?:([0-9]+)M)*(?:([0-9]+)S)*", s.upper().replace(" ", "").strip()) if match: @@ -33,26 +30,28 @@ class Reminders(commands.Cog): self.tasks = [] @commands.group("reminder", pass_context=True) - @commands.guild_only() async def reminder(self, ctx: commands.Context): if ctx.invoked_subcommand is None: raise CommandNotFound() @reminder.group("help", pass_context=True) - @commands.guild_only() async def reminder_help(self, ctx: commands.Context): embed = Embed(title="Reminder help") embed.add_field(name="speak add