Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
dc107ebdb3
|
|||
33c33d08e2
|
|||
295e77e403
|
|||
279a8e9d84
|
@@ -1,5 +1,5 @@
|
|||||||
__name__ = "libbot"
|
__name__ = "libbot"
|
||||||
__version__ = "1.7"
|
__version__ = "1.9"
|
||||||
__license__ = "GPL3"
|
__license__ = "GPL3"
|
||||||
__author__ = "Profitroll"
|
__author__ = "Profitroll"
|
||||||
|
|
||||||
|
@@ -59,6 +59,7 @@ class PyroClient(Client):
|
|||||||
max_concurrent_transmissions: int = 1,
|
max_concurrent_transmissions: int = 1,
|
||||||
commands_source: Union[Dict[str, dict], None] = None,
|
commands_source: Union[Dict[str, dict], None] = None,
|
||||||
scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = None,
|
scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = None,
|
||||||
|
**kwargs,
|
||||||
):
|
):
|
||||||
if config is None:
|
if config is None:
|
||||||
with open(config_path, "r", encoding="utf-8") as f:
|
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"]
|
if "max_concurrent_transmissions" in self.config["bot"]
|
||||||
else max_concurrent_transmissions,
|
else max_concurrent_transmissions,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
self.owner: int = self.config["bot"]["owner"]
|
self.owner: int = self.config["bot"]["owner"]
|
||||||
self.commands: List[PyroCommand] = []
|
self.commands: List[PyroCommand] = []
|
||||||
@@ -128,7 +130,9 @@ class PyroClient(Client):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
await self.send_message(
|
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()}`",
|
text=f"Bot started PID `{getpid()}`",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -150,7 +154,9 @@ class PyroClient(Client):
|
|||||||
async def stop(self, exit_completely: bool = True):
|
async def stop(self, exit_completely: bool = True):
|
||||||
try:
|
try:
|
||||||
await self.send_message(
|
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()}`",
|
text=f"Bot stopped with PID `{getpid()}`",
|
||||||
)
|
)
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "libbot"
|
name = "libbot"
|
||||||
version = "1.7"
|
version = "1.9"
|
||||||
authors = [{ name = "Profitroll" }]
|
authors = [{ name = "Profitroll" }]
|
||||||
description = "Universal bot library with functions needed for basic Discord/Telegram bot development."
|
description = "Universal bot library with functions needed for basic Discord/Telegram bot development."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
Reference in New Issue
Block a user