This repository has been archived on 2023-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
MirrorTea/mirrortea
2023-01-08 01:42:02 +04:00

34 lines
765 B
Python
Executable file

#!/usr/bin/env python3
import asyncio
import aiogram as telegram
import nio as matrix
MATRIX_HOMESERVER_URL = 'https://matrix.org'
MATRIX_FULL_USER_ID = '@fckidiots:matrix.org'
MATRIX_PASSWORD = '...'
TELEGRAM_BOT_TOKEN = '5890667880:...'
async def main():
try:
matrix_client = \
matrix.AsyncClient(MATRIX_HOMESERVER_URL, MATRIX_FULL_USER_ID)
await matrix_client.login(MATRIX_PASSWORD)
telegram_client = telegram.Bot(token=TELEGRAM_BOT_TOKEN)
await asyncio.gather(matrix_loop(), telegram_loop())
finally:
if matrix_client:
await matrix_client.close()
async def matrix_loop():
print(123)
async def telegram_loop():
print(456)
if __name__ == '__main__':
asyncio.run(main())