]>
apps.delaporte.us Git - matrix-goal-bot.git/blob - app.py
d9254b80d0153c9623b3c0a599fc1d654bcf9b19
3 from matrix_goal_bot
.bot
import GoalBot
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', 'goal.db')
17 kwargs
['db_file'] = os
.path
.join(DATA_DIR
, DB_FILE
)
19 goal_bot
= GoalBot(**kwargs
)
21 @goal_bot.bot.listener.on_message_event
22 async def do_bot_stuff(room
, message
):
23 '''Pass messages to our bot'''
24 await goal_bot
.handle_message(room
, message
)