Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SlackBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

# there are no comments here
def append_history(t):
"""
Append a session entry to the global history, keeping history length at most 20.

Parameters:
t (dict): A history entry (e.g., session data with keys like 'user' and 'time') to append.

Returns:
bool: Always returns True after appending.
"""
if len(history) > 20:
del history[:1]
history.append(t)
Expand Down