Fix trigger time check to ensure user presence in last_trigger_time dictionary
This commit is contained in:
parent
489d8980c8
commit
c3ae6c7073
1 changed files with 1 additions and 1 deletions
2
misc.py
2
misc.py
|
|
@ -102,7 +102,7 @@ def should_respond_without_trigger(channel_id: str, user: str, threshold_seconds
|
||||||
Returns:
|
Returns:
|
||||||
True if the bot should respond without trigger keywords, False otherwise.
|
True if the bot should respond without trigger keywords, False otherwise.
|
||||||
"""
|
"""
|
||||||
if channel_id not in last_trigger_time:
|
if channel_id not in last_trigger_time or user not in last_trigger_time[channel_id]:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
last_trigger: datetime.datetime = last_trigger_time[channel_id][user]
|
last_trigger: datetime.datetime = last_trigger_time[channel_id][user]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue