Fix Telegram webhook registration if deregistration previously failed (#133398)

This commit is contained in:
Roman Sivriver 2025-01-28 10:46:08 -05:00 committed by GitHub
parent b16c3a55a5
commit 52dc124cfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,13 +109,12 @@ class PushBot(BaseTelegramBotEntity):
else:
_LOGGER.debug("telegram webhook status: %s", current_status)
if current_status and current_status["url"] != self.webhook_url:
result = await self._try_to_set_webhook()
if result:
_LOGGER.debug("Set new telegram webhook %s", self.webhook_url)
else:
_LOGGER.error("Set telegram webhook failed %s", self.webhook_url)
return False
result = await self._try_to_set_webhook()
if result:
_LOGGER.debug("Set new telegram webhook %s", self.webhook_url)
else:
_LOGGER.error("Set telegram webhook failed %s", self.webhook_url)
return False
return True