Added support for libbot 4.1.0
This commit is contained in:
parent
e906852abe
commit
b85ca1d017
10
main.py
10
main.py
@ -3,8 +3,9 @@ import logging
|
||||
from argparse import ArgumentParser
|
||||
from os import getpid
|
||||
from pathlib import Path
|
||||
from sys import exit
|
||||
|
||||
from libbot import sync
|
||||
from libbot.utils import config_get, json_read
|
||||
|
||||
from classes.pyroclient import PyroClient
|
||||
|
||||
@ -22,7 +23,7 @@ from modules.scheduler import scheduler
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG if sync.config_get("debug") else logging.INFO,
|
||||
level=logging.DEBUG if config_get("debug") else logging.INFO,
|
||||
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
|
||||
datefmt="[%X]",
|
||||
)
|
||||
@ -53,7 +54,7 @@ def main():
|
||||
exit()
|
||||
|
||||
client = PyroClient(
|
||||
scheduler=scheduler, commands_source=sync.json_read(Path("commands.json"))
|
||||
scheduler=scheduler, commands_source=json_read(Path("commands.json"))
|
||||
)
|
||||
# Conversation(client)
|
||||
|
||||
@ -61,6 +62,9 @@ def main():
|
||||
client.run()
|
||||
except KeyboardInterrupt:
|
||||
logger.warning("Forcefully shutting down with PID %s...", getpid())
|
||||
except Exception as exc:
|
||||
logger.error("An unexpected exception has occurred: %s", exc, exc_info=exc)
|
||||
exit(1)
|
||||
finally:
|
||||
if client.scheduler is not None:
|
||||
client.scheduler.shutdown()
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Any, Mapping
|
||||
|
||||
from async_pymongo import AsyncClient, AsyncCollection, AsyncDatabase
|
||||
from libbot.sync import config_get
|
||||
from libbot.utils import config_get
|
||||
|
||||
db_config: Mapping[str, Any] = config_get("database")
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import sqlite3
|
||||
from pathlib import Path
|
||||
|
||||
from libbot.sync import config_get
|
||||
from libbot.utils import config_get
|
||||
|
||||
db: sqlite3.Connection = sqlite3.connect(Path(config_get("database")))
|
||||
cursor: sqlite3.Cursor = db.cursor()
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import Any, Mapping
|
||||
|
||||
from libbot.sync import config_get
|
||||
from libbot.utils import config_get
|
||||
from mongodb_migrations.cli import MigrationManager
|
||||
from mongodb_migrations.config import Configuration
|
||||
|
||||
|
@ -2,7 +2,7 @@ from os import rename
|
||||
from pathlib import Path
|
||||
from typing import Mapping
|
||||
|
||||
from libbot.sync import json_read
|
||||
from libbot.utils import json_read
|
||||
|
||||
from modules.database_sqlite import cursor
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
apscheduler~=3.10.4
|
||||
apscheduler~=3.11.0
|
||||
async_pymongo==0.1.9
|
||||
convopyro==0.5
|
||||
tgcrypto==1.2.5
|
||||
libbot[speed,pyrogram]==4.1.0
|
||||
tgcrypto-pyrofork==1.2.7
|
||||
uvloop==0.21.0
|
||||
# If uses MongoDB:
|
||||
mongodb-migrations==1.3.1
|
||||
--extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple
|
||||
libbot[speed,pyrogram]==3.2.3
|
||||
pykeyboard==0.1.7
|
Loading…
x
Reference in New Issue
Block a user