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: else:
_LOGGER.debug("telegram webhook status: %s", current_status) _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()
result = await self._try_to_set_webhook() if result:
if result: _LOGGER.debug("Set new telegram webhook %s", self.webhook_url)
_LOGGER.debug("Set new telegram webhook %s", self.webhook_url) else:
else: _LOGGER.error("Set telegram webhook failed %s", self.webhook_url)
_LOGGER.error("Set telegram webhook failed %s", self.webhook_url) return False
return False
return True return True