fix restart and added stop cmd

pull/167/head^2
Who? 2025-08-22 17:50:08 +07:00 committed by GitHub
parent 962e7ec36a
commit e333ddfa0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 1 deletions

View File

@ -301,7 +301,7 @@ class UpdaterMod(loader.Module):
# await self._db.remote_force_save()
if "LAVHOST" in os.environ:
os.system("lavhost restart")
await self.client.send_message("lavhostbot", "🔄 Restart")
return
with contextlib.suppress(Exception):
@ -693,3 +693,15 @@ class UpdaterMod(loader.Module):
await asyncio.create_subprocess_shell(f'git reset --hard HEAD~{number}', stdout=asyncio.subprocess.PIPE)
await self.restart_common(call)
@loader.command()
async def stop(self, message: Message):
"""| stops your userbot"""
if "LAVHOST" in os.environ:
await utils.answer(message, self.strings[" lavhost_stop"]
await self.client.send.message("lavhostbot", "⏹ Stop")
else:
await utils.answer(message, self.strings[" ub_stop"]
exit()