]>
apps.delaporte.us Git - matrix-fridge-bot.git/blob - app.py
682b96afefbe40273ef68b2ea1122f31c5adaeba
3 from matrix_chore_bot
.bot
import ChoreBot
6 # How to connect to Matrix
7 kwargs
['matrix_server'] = os
.environ
.get('MATRIX_SERVER')
8 kwargs
['bot_name'] = os
.environ
.get('MATRIX_BOT')
9 kwargs
['bot_pwd'] = os
.environ
.get('MATRIX_BOT_PWD')
11 # Prefix to listen for
12 kwargs
['bot_prefix'] = os
.environ
.get('MATRIX_BOT_PREFIX', '!chore')
15 DATA_DIR
= os
.environ
.get('MATRIX_DATA_DIR', '')
16 DB_FILE
= os
.environ
.get('MATRIX_DB_FILE', 'chore.db')
17 kwargs
['db_file'] = os
.path
.join(DATA_DIR
, DB_FILE
)
21 chore_bot
= ChoreBot(**kwargs
)
23 @chore_bot.bot.listener.on_message_event
24 async def do_bot_stuff(room
, message
):
25 '''Pass messages to our bot'''
26 await chore_bot
.handle_message(room
, message
)