This repository has been archived on 2024-10-15. You can view files and clone it, but cannot push or open issues or pull requests.
PyrogramBotBase/main.py
2023-05-14 21:27:07 +02:00

35 lines
589 B
Python

import logging
from os import getpid
from modules.app import PyroClient
logging.basicConfig(
level=logging.INFO,
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
datefmt="[%X]",
)
logger = logging.getLogger(__name__)
try:
import uvloop
uvloop.install()
except ImportError:
pass
def main():
client = PyroClient()
try:
client.run()
except KeyboardInterrupt:
logger.warning(f"Forcefully shutting down with PID {getpid()}...")
finally:
client.__exit__()
exit()
if __name__ == "__main__":
main()