Updated to libbot 1.3 replacing old classes

This commit is contained in:
2023-06-26 12:50:21 +02:00
parent a5a9a97dbc
commit 086dcd5253
10 changed files with 11 additions and 314 deletions

View File

@@ -2,7 +2,8 @@ import contextlib
import logging
from os import getpid
from classes.pyroclient import PyroClient
from libbot.pyrogram.classes import PyroClient
from modules.scheduler import scheduler
# Uncomment this and the line below client declaration
@@ -27,7 +28,7 @@ with contextlib.suppress(ImportError):
def main():
client = PyroClient()
client = PyroClient(scheduler=scheduler)
# Conversation(client)
try:
@@ -35,7 +36,8 @@ def main():
except KeyboardInterrupt:
logger.warning("Forcefully shutting down with PID %s...", getpid())
finally:
scheduler.shutdown()
if client.scheduler is not None:
client.scheduler.shutdown()
exit()