BWTAqua/bwtbot.py

38 lines
625 B
Python
Raw Normal View History

2023-05-16 21:50:18 +03:00
import logging
from os import getpid
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
from convopyro import Conversation
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
from modules.app import PyroClient
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
logging.basicConfig(
level=logging.INFO,
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
datefmt="[%X]",
2023-03-18 01:52:15 +02:00
)
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
logger = logging.getLogger(__name__)
2023-05-16 21:50:18 +03:00
try:
import uvloop
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
uvloop.install()
except ImportError:
pass
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
def main():
client = PyroClient()
Conversation(client)
2022-09-08 13:12:25 +03:00
try:
2023-05-16 21:50:18 +03:00
client.run()
except KeyboardInterrupt:
logger.warning(f"Forcefully shutting down with PID {getpid()}...")
finally:
exit()
2022-09-08 13:12:25 +03:00
2023-05-16 21:50:18 +03:00
if __name__ == "__main__":
main()