diff --git a/royalnet/commands/royalgames/mm.py b/royalnet/commands/royalgames/mm.py index 0621e628..49cd1e14 100644 --- a/royalnet/commands/royalgames/mm.py +++ b/royalnet/commands/royalgames/mm.py @@ -71,7 +71,11 @@ class MmCommand(Command): raise UnsupportedError("mm is supported only on Telegram") client: telegram.Bot = self.interface.bot.client creator = await data.get_author(error_if_none=True) - timestring, title, description = args.match(r"\[\s*([^]]+)\s*]\s*([^\n]+)\s*\n?\s*(.+)?\s*") + + try: + timestring, title, description = args.match(r"\[\s*([^]]+)\s*]\s*([^\n]+)\s*\n?\s*(.+)?\s*") + except InvalidInputError: + timestring, title, description = args.match(r"\s*(.+?)\s*\n\s*([^\n]+)\s*\n?\s*(.+)?\s*") try: dt: typing.Optional[datetime.datetime] = dateparser.parse(timestring) diff --git a/royalnet/commands/royalgames/reminder.py b/royalnet/commands/royalgames/reminder.py index bbfe850b..df3c156d 100644 --- a/royalnet/commands/royalgames/reminder.py +++ b/royalnet/commands/royalgames/reminder.py @@ -53,7 +53,11 @@ class ReminderCommand(Command): await channel.send(discord_escape(f"❗️ {reminder.message}")) async def run(self, args: CommandArgs, data: CommandData) -> None: - date_str, reminder_text = args.match(r"\[ *(.+?) *] *(.+?) *$") + try: + date_str, reminder_text = args.match(r"\[\s*([^]]+)\s*]\s*([^\n]+)\s*") + except InvalidInputError: + date_str, reminder_text = args.match(r"\s*(.+?)\s*\n\s*([^\n]+)\s*") + try: date: typing.Optional[datetime.datetime] = dateparser.parse(date_str) except OverflowError: