plugable-matrix-bot/run.py
Dennis 57499db3f5 Initial commit of software
This commit includes the matrix bot API
(https://github.com/shawnanastasio/python-matrix-bot-api/) and the first
proof of concept that the plugin API works. Furthermore, it includes the
first version of a plugin that acquires event from an Admidio setup
(https://admidio.org).
2018-12-16 16:38:47 +01:00

32 lines
637 B
Python
Executable File

#!/usr/bin/env python3
"""
This is Peter. Peter is using the Python Matrix Bot API
"""
import json
# Bot API import
from matrix_bot_api.matrix_bot_api import MatrixBotAPI
def main():
# Load the configuration
with open('config.json') as json_data:
config = json.load(json_data)
# Create an instance of the MatrixBotAPI
bot = MatrixBotAPI(config)
# Start polling
bot.start_polling()
# Infinitely read stdin to stall main thread while the bot runs in other
# threads.
try:
while True:
input()
except:
bot.cancel = True
if __name__ == "__main__":
main()