]> us-delaporte.pagekite.me Git - matrix-chore-bot.git/blob - app.py
Add ability to run with separate prefix and database file
[matrix-chore-bot.git] / app.py
1 import os
2
3 import simplematrixbotlib as botlib
4
5 from matrix_chore_bot.bot import chore_bot
6
7 SERVER = os.environ.get('MATRIX_SERVER')
8 BOT_NAME = os.environ.get('MATRIX_BOT')
9 BOT_PWD = os.environ.get('MATRIX_BOT_PWD')
10 BOT_PREFIX = os.environ.get('MATRIX_BOT_PREFIX', '!chore')
11
12 def get_bot():
13 creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
14 return botlib.Bot(creds)
15
16 bot = get_bot()
17
18 @bot.listener.on_message_event
19 async def do_bot_stuff(room, message):
20 await chore_bot(room, message, bot, BOT_PREFIX)
21
22 bot.run()