Updated to libbot 1.3 replacing old classes
This commit is contained in:
8
main.py
8
main.py
@@ -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()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user