Compare commits

..

2 Commits
v1.4 ... v1.5

Author SHA1 Message Date
c71a7555f9 Updated to 1.5 2023-06-26 13:29:47 +02:00
cb755faa9a Added scopes_placeholders 2023-06-26 13:29:26 +02:00
3 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
__name__ = "libbot"
__version__ = "1.4"
__version__ = "1.5"
__license__ = "GPL3"
__author__ = "Profitroll"

View File

@@ -3,7 +3,7 @@ from datetime import datetime, timedelta
from os import cpu_count, getpid
from pathlib import Path
from time import time
from typing import List, Union
from typing import Dict, List, Union
try:
import pyrogram
@@ -80,6 +80,8 @@ class PyroClient(Client):
self.scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = scheduler
self.scopes_placeholders: Dict[str, int] = {"owner": self.owner}
async def start(self):
await super().start()
@@ -164,8 +166,9 @@ class PyroClient(Client):
scope_dict = loads(scope)
# Replace "owner" in the bot scope with owner's id
if "chat_id" in scope_dict and scope_dict["chat_id"] == "owner":
scope_dict["chat_id"] = self.owner
for placeholder, chat_id in self.scopes_placeholders.items():
if "chat_id" in scope_dict and scope_dict["chat_id"] == placeholder:
scope_dict["chat_id"] = chat_id
# Create object with the same name and args from the dict
try:

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "libbot"
version = "1.4"
version = "1.5"
authors = [{ name = "Profitroll" }]
description = "Universal bot library with functions needed for basic Discord/Telegram bot development."
readme = "README.md"