diff --git a/fifo/fifo.py b/fifo/fifo.py index 4a0e622..c6479b4 100644 --- a/fifo/fifo.py +++ b/fifo/fifo.py @@ -27,6 +27,7 @@ async def _execute_task(task_state): task = Task(**task_state) if await task.load_from_config(): return await task.execute() + log.warning(f"Failed to load data on {task_state=}") return False diff --git a/fifo/task.py b/fifo/task.py index 4c77e8b..9e0e545 100644 --- a/fifo/task.py +++ b/fifo/task.py @@ -253,15 +253,15 @@ class Task: actual_message = await author.history(limit=1).flatten() if not actual_message: # Okay, the *author* has never sent a message? log.warning("No message found in channel cache yet, skipping execution") - return + return False actual_message = actual_message[0] message = FakeMessage(actual_message) # message = FakeMessage2 message.author = author - message.guild = guild # Just in case we got desperate + message.guild = guild # Just in case we got desperate, see above message.channel = channel - message.id = time_snowflake(datetime.now()) # Pretend to be now + message.id = time_snowflake(datetime.utcnow(), high=False) # Pretend to be now message = neuter_message(message) # absolutely weird that this takes a message object instead of guild @@ -273,7 +273,12 @@ class Task: message.content = f"{prefix}{self.get_command_str()}" - if not message.guild or not message.author or not message.content: + if ( + not message.guild + or not message.author + or not message.content + or message.content == prefix + ): log.warning(f"Could not execute task due to message problem: {message}") return False