This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.py
54 lines (44 loc) · 1.61 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import asyncio
import json
import os
import traceback
from sys import platform
import pyfiglet
import requests
from colorama import init
from termcolor import colored
from src.utils import logger, file_logger
from src.service import ServiceApp
async def main():
if platform != "linux":
from ctypes import windll
windll.kernel32.SetConsoleTitleW("Amino Service")
os.system('cls' if os.name == 'nt' else 'clear')
init()
__info__ = json.loads(requests.get("https://github.com/LynxN1/amino_service/raw/master/version.json").text)
__version__ = __info__["version"]
__author__ = __info__["author"]
__github__ = __info__["github"]
__telegram__ = __info__["telegram"]
try:
__current__ = json.loads(open("version.json").read())["version"]
except:
__current__ = None
if __version__ != __current__:
logger.warning(f"New version of Amino Service available! ({__version__})\n")
logger.info(colored(pyfiglet.figlet_format("Amino Service", font="big"), "green"))
logger.info(colored(f"Author {__author__}\n"
f"Version {__current__}\n"
f"Github {__github__}\n"
f"Telegram {__telegram__}\n", "green"))
logger.info("Проект закрыт. Мой телеграм канал: https://t.me/amino_dev0")
input()
exit(0)
try:
await ServiceApp().start()
except Exception as e:
logger.error(e)
file_logger.debug(traceback.format_exc())
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())