|
|
@ -2,8 +2,8 @@ from datetime import datetime
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
|
|
|
|
from apscheduler.triggers.cron import CronTrigger
|
|
|
|
from apscheduler.triggers.cron import CronTrigger
|
|
|
|
from discord.ext.commands import BadArgument, Converter
|
|
|
|
|
|
|
|
from dateutil import parser
|
|
|
|
from dateutil import parser
|
|
|
|
|
|
|
|
from discord.ext.commands import BadArgument, Converter
|
|
|
|
|
|
|
|
|
|
|
|
from fifo.timezones import assemble_timezones
|
|
|
|
from fifo.timezones import assemble_timezones
|
|
|
|
|
|
|
|
|
|
|
@ -11,6 +11,7 @@ if TYPE_CHECKING:
|
|
|
|
DatetimeConverter = datetime
|
|
|
|
DatetimeConverter = datetime
|
|
|
|
CronConverter = str
|
|
|
|
CronConverter = str
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
|
|
|
|
|
|
|
|
class DatetimeConverter(Converter):
|
|
|
|
class DatetimeConverter(Converter):
|
|
|
|
async def convert(self, ctx, argument) -> datetime:
|
|
|
|
async def convert(self, ctx, argument) -> datetime:
|
|
|
|
dt = parser.parse(argument, fuzzy=True, tzinfos=assemble_timezones())
|
|
|
|
dt = parser.parse(argument, fuzzy=True, tzinfos=assemble_timezones())
|
|
|
@ -25,4 +26,4 @@ else:
|
|
|
|
except ValueError:
|
|
|
|
except ValueError:
|
|
|
|
raise BadArgument()
|
|
|
|
raise BadArgument()
|
|
|
|
|
|
|
|
|
|
|
|
return argument
|
|
|
|
return argument
|
|
|
|