-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (23 loc) · 835 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import configparser
import asyncio
from src.interface.interface import Window
from PyQt5 import QtWidgets
from telethon import TelegramClient
from pyrogram import Client
config = configparser.ConfigParser()
config.read('settings.ini')
phone = config['Telegram']['phone']
api_id = config['Telegram']['api_id']
api_hash = config['Telegram']['api_hash']
if __name__ == '__main__':
loop = asyncio.get_event_loop()
telethon_client = TelegramClient(phone, int(api_id), api_hash, loop=loop)
pyrogram_client = Client('my_account', api_id=api_id, api_hash=api_hash)
with telethon_client:
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
ui = Window()
ui.setup(window, telethon_client, pyrogram_client, loop)
window.show()
sys.exit(app.exec_())