diff --git a/fifo/datetime_cron_converters.py b/fifo/datetime_cron_converters.py index 5382b07..d59ef37 100644 --- a/fifo/datetime_cron_converters.py +++ b/fifo/datetime_cron_converters.py @@ -2,8 +2,8 @@ from datetime import datetime from typing import TYPE_CHECKING from apscheduler.triggers.cron import CronTrigger -from discord.ext.commands import BadArgument, Converter from dateutil import parser +from discord.ext.commands import BadArgument, Converter from fifo.timezones import assemble_timezones @@ -11,6 +11,7 @@ if TYPE_CHECKING: DatetimeConverter = datetime CronConverter = str else: + class DatetimeConverter(Converter): async def convert(self, ctx, argument) -> datetime: dt = parser.parse(argument, fuzzy=True, tzinfos=assemble_timezones()) @@ -25,4 +26,4 @@ else: except ValueError: raise BadArgument() - return argument \ No newline at end of file + return argument diff --git a/fifo/fifo.py b/fifo/fifo.py index 38bef79..e84e342 100644 --- a/fifo/fifo.py +++ b/fifo/fifo.py @@ -9,7 +9,7 @@ from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.schedulers.base import STATE_PAUSED, STATE_RUNNING from redbot.core import Config, checks, commands from redbot.core.bot import Red -from redbot.core.commands import DictConverter, TimedeltaConverter +from redbot.core.commands import TimedeltaConverter from .datetime_cron_converters import CronConverter, DatetimeConverter from .task import Task diff --git a/fifo/redconfigjobstore.py b/fifo/redconfigjobstore.py index aa6d967..7e68697 100644 --- a/fifo/redconfigjobstore.py +++ b/fifo/redconfigjobstore.py @@ -3,7 +3,6 @@ import base64 import logging import pickle from datetime import datetime -from time import sleep from typing import Tuple, Union from apscheduler.job import Job diff --git a/fifo/task.py b/fifo/task.py index 5d16ec9..83158d8 100644 --- a/fifo/task.py +++ b/fifo/task.py @@ -5,9 +5,9 @@ from typing import Dict, List, Union import discord from apscheduler.triggers.base import BaseTrigger from apscheduler.triggers.combining import OrTrigger +from apscheduler.triggers.cron import CronTrigger from apscheduler.triggers.date import DateTrigger from apscheduler.triggers.interval import IntervalTrigger -from apscheduler.triggers.cron import CronTrigger from discord.utils import time_snowflake from redbot.core import Config, commands from redbot.core.bot import Red