This repository has been archived on 2024-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
BWTAqua/bwtbot.py
2023-07-14 12:39:12 +02:00

37 lines
636 B
Python

import logging
from os import getpid
from convopyro import Conversation
from libbot.pyrogram.classes 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()
Conversation(client)
try:
client.run()
except KeyboardInterrupt:
logger.warning(f"Forcefully shutting down with PID {getpid()}...")
finally:
exit()
if __name__ == "__main__":
main()