Compare commits

...

4 Commits
v1.7 ... v1.9

Author SHA1 Message Date
dc107ebdb3 Updated to 1.9 2023-07-26 14:12:13 +02:00
33c33d08e2 Allowed passing kwargs 2023-07-26 14:12:05 +02:00
295e77e403 Updated to 1.8 2023-07-03 10:57:00 +02:00
279a8e9d84 reports.chat_id can now be "owner" 2023-07-03 10:56:24 +02:00
3 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
__name__ = "libbot"
__version__ = "1.7"
__version__ = "1.9"
__license__ = "GPL3"
__author__ = "Profitroll"

View File

@@ -59,6 +59,7 @@ class PyroClient(Client):
max_concurrent_transmissions: int = 1,
commands_source: Union[Dict[str, dict], None] = None,
scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = None,
**kwargs,
):
if config is None:
with open(config_path, "r", encoding="utf-8") as f:
@@ -90,6 +91,7 @@ class PyroClient(Client):
]
if "max_concurrent_transmissions" in self.config["bot"]
else max_concurrent_transmissions,
**kwargs,
)
self.owner: int = self.config["bot"]["owner"]
self.commands: List[PyroCommand] = []
@@ -128,7 +130,9 @@ class PyroClient(Client):
try:
await self.send_message(
chat_id=self.config["reports"]["chat_id"],
chat_id=self.owner
if self.config["reports"]["chat_id"] == "owner"
else self.config["reports"]["chat_id"],
text=f"Bot started PID `{getpid()}`",
)
@@ -150,7 +154,9 @@ class PyroClient(Client):
async def stop(self, exit_completely: bool = True):
try:
await self.send_message(
chat_id=self.config["reports"]["chat_id"],
chat_id=self.owner
if self.config["reports"]["chat_id"] == "owner"
else self.config["reports"]["chat_id"],
text=f"Bot stopped with PID `{getpid()}`",
)
await asyncio.sleep(0.5)

View File

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