summaryrefslogtreecommitdiff
path: root/predicates.py
diff options
context:
space:
mode:
Diffstat (limited to 'predicates.py')
-rw-r--r--predicates.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/predicates.py b/predicates.py
index 992972d..c341ccf 100644
--- a/predicates.py
+++ b/predicates.py
@@ -29,3 +29,10 @@ def has_finished_event(
return last_event is not None and \
last_event["user"] == normalize_username(username) and \
is_past(last_event["when"])
+
+
+def has_unfinished_event(context: ContextTypes.DEFAULT_TYPE) -> bool:
+ events = context.chat_data["events"]
+ last_event = events[-1] if events != [] else None
+
+ return False if last_event is None else not is_past(last_event["when"])