plugable-matrix-bot/matrix_bot_api/mhandler.py

14 lines
456 B
Python
Raw Normal View History

"""
Defines a Matrix bot message handler
"""
class MHandler(object):
# test_callback - function that takes a room and event and returns a boolean
# indicating whether we should pass the message on to handle_callback
#
# handle_callback - function that takes a room and event and handles them
def __init__(self, test_callback, handle_callback):
self.test_callback = test_callback
self.handle_callback = handle_callback