diff --git a/stdborg.py b/stdborg.py index 81143bb..6e82efe 100644 --- a/stdborg.py +++ b/stdborg.py @@ -8,6 +8,6 @@ from uniborg import Uniborg logging.basicConfig(level=logging.INFO) -borg = Uniborg("stdborg", plugin_path="stdplugins") +borg = Uniborg("stdborg", plugin_path="stdplugins", connection_retries=None) -borg.run() +borg.run_until_disconnected() diff --git a/uniborg/uniborg.py b/uniborg/uniborg.py index 0eabbfc..97465f1 100644 --- a/uniborg/uniborg.py +++ b/uniborg/uniborg.py @@ -52,21 +52,6 @@ class Uniborg(TelegramClient): self.me = await self.get_me() self.uid = telethon.utils.get_peer_id(self.me) - async def _reconnect_nofail(self): - while True: - try: - await self.connect() - return - except ConnectionError: - pass - - def run(self): - while True: - try: - self.run_until_disconnected() - except ConnectionError: - self.loop.run_until_complete(self._reconnect_nofail()) - def load_plugin(self, shortname): self.load_plugin_from_file(f"{self._plugin_path}/{shortname}.py")