mbot/main.py

22 lines
464 B
Python
Raw Normal View History

2024-06-06 17:55:29 +00:00
"""Matrix Bot Framework"""
import asyncio
import json
2024-06-06 17:59:53 +00:00
from matrix import MatrixBot
2024-06-06 17:55:29 +00:00
def load_config(path: str) -> dict:
with open(path, 'r', encoding='utf-8') as f:
return json.loads(f.read())
async def main():
config = load_config("config.json")
bot = MatrixBot(config['matrix'])
await bot.send_message("beep boop, i'm a bot")
await bot.logout()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())