-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
37 lines (29 loc) · 929 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
30
31
32
33
34
35
36
37
# Fly-telegram UserBot
# this code is licensed by cc-by-nc (https://creativecommons.org/share-your-work/cclicenses)
from pyrogram import Client
from pyrogram.enums.parse_mode import ParseMode
from utils.parse_arguments import parse
from database.types import account
from utils.core import main
from utils.git import *
import logging
try:
import uvloop
uvloop.install()
except ModuleNotFoundError:
pass
parser = parse()
client = Client(
"./account/telegram",
api_id=account.get("id"),
api_hash=account.get("hash"),
app_version=".".join(map(str, version)),
device_model="Fly Telegram",
parse_mode=ParseMode.HTML,
session_string=parser.session_string if parser.session_string else None,
test_mode=parser.test if parser.test else False
)
try:
client.run(main(client))
except RuntimeError as e:
logging.error(f"Connection failed! {e}")