#!/usr/bin/env python3 """ Create a Matrix room for print orders """ import json import requests access_token = "syt_ZWluc3p3b3ZpZXI_vebsCCpDYUkfsqLgnvjz_1WOI0g" user_id = "@einszwovier:124.local" # Create room data = { "name": "Print Orders", "topic": "PDF print order submissions from the web app", "preset": "private_chat", "visibility": "private" } headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } response = requests.post( "http://localhost:8008/_matrix/client/r0/createRoom", json=data, headers=headers ) print(f"Room creation response: {response.status_code}") print(json.dumps(response.json(), indent=2)) if response.status_code == 200: room_id = response.json()['room_id'] print(f"\nāœ… Room created successfully!") print(f"Room ID: {room_id}") print(f"\nšŸ“‹ Add this to your .env file:") print(f"MATRIX_ROOM={room_id}") else: print(f"\nāŒ Room creation failed")