Add StateHandler to contrib_bots/run.py.
This allows bots to be stateful. It doesn't handle persistence after the bot shuts down, but it does store state between invocations of handle_message.
This commit is contained in:
parent
2ed9f15ff7
commit
0dab69b76f
3 changed files with 17 additions and 3 deletions
|
@ -37,7 +37,7 @@ class FollowupHandler(object):
|
|||
|
||||
return is_follow_up
|
||||
|
||||
def handle_message(self, message, client):
|
||||
def handle_message(self, message, client, state_handler):
|
||||
original_content = message['content']
|
||||
original_sender = message['sender_email']
|
||||
new_content = original_content.replace('@followup',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue