]> us-delaporte.pagekite.me Git - matrix-shop-bot.git/blob - app.py
01be94e12d5bf8a0e107c6a30cc12bb9f2159a8c
[matrix-shop-bot.git] / app.py
1 from matrix_shop_bot.bot import shop_bot
2
3 SERVER = os.environ.get('MATRIX_SERVER')
4 BOT_NAME = os.environ.get('GOAL_BOT')
5 BOT_PWD = os.environ.get('GOAL_BOT_PWD')
6
7 def get_bot():
8 creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
9 return botlib.Bot(creds)
10
11 bot = get_bot()
12
13 @bot.listener.on_message_event
14 async def do_bot_stuff(room, message):
15 await shop_bot(room, message, bot)
16
17 bot.run()