Compare commits
10 Commits
a47a508ecf
...
v3.3.1
Author | SHA1 | Date | |
---|---|---|---|
9907cc50f1 | |||
1b60257bc5 | |||
171e36a491 | |||
c419c684aa | |||
748b2b2abb | |||
52c2e5cc13 | |||
55c61e3fce | |||
b9550032ba | |||
5ba763246b | |||
f0ffdf096d |
@@ -1,11 +1,11 @@
|
||||
black==24.10.0
|
||||
build==1.2.2.post1
|
||||
isort==5.13.2
|
||||
mypy==1.14.0
|
||||
pylint==3.3.3
|
||||
mypy==1.13.0
|
||||
pylint==3.3.2
|
||||
pytest-asyncio==0.25.0
|
||||
pytest-cov==6.0.0
|
||||
pytest==8.3.4
|
||||
tox==4.23.2
|
||||
types-aiofiles==24.1.0.20241221
|
||||
types-aiofiles==24.1.0.20240626
|
||||
types-ujson==5.10.0.20240515
|
@@ -59,15 +59,3 @@ class PycordBot(Bot):
|
||||
self.in_every_locale = self.bot_locale.in_every_locale
|
||||
|
||||
self.scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = scheduler
|
||||
|
||||
async def start(self, token: str, reconnect: bool = True, scheduler_start: bool = True) -> None:
|
||||
if self.scheduler is not None and scheduler_start:
|
||||
self.scheduler.start()
|
||||
|
||||
await super().start(token, reconnect=reconnect)
|
||||
|
||||
async def close(self, scheduler_shutdown: bool = True, scheduler_wait: bool = True) -> None:
|
||||
if self.scheduler is not None and scheduler_shutdown:
|
||||
self.scheduler.shutdown(scheduler_wait)
|
||||
|
||||
await super().close()
|
||||
|
@@ -125,7 +125,7 @@ class PyroClient(Client):
|
||||
|
||||
self.i18n_bot_info: bool = i18n_bot_info
|
||||
|
||||
async def start(self, register_commands: bool = True, scheduler_start: bool = True) -> None:
|
||||
async def start(self, register_commands: bool = True) -> None:
|
||||
await super().start()
|
||||
|
||||
self.start_time = time()
|
||||
@@ -209,12 +209,9 @@ class PyroClient(Client):
|
||||
kwargs={"command_sets": await self.collect_commands()},
|
||||
)
|
||||
|
||||
if scheduler_start:
|
||||
self.scheduler.start()
|
||||
|
||||
async def stop(
|
||||
self, exit_completely: bool = True, scheduler_shutdown: bool = True, scheduler_wait: bool = True
|
||||
) -> None:
|
||||
async def stop(self, exit_completely: bool = True) -> None:
|
||||
try:
|
||||
await self.send_message(
|
||||
chat_id=self.owner
|
||||
@@ -226,9 +223,6 @@ class PyroClient(Client):
|
||||
except BadRequest:
|
||||
logger.warning("Unable to send message to report chat.")
|
||||
|
||||
if self.scheduler is not None and scheduler_shutdown:
|
||||
self.scheduler.shutdown(scheduler_wait)
|
||||
|
||||
await super().stop()
|
||||
logger.warning("Bot stopped with PID %s.", getpid())
|
||||
|
||||
|
Reference in New Issue
Block a user