1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-21 18:38:17 +00:00
Files
core/homeassistant/components/telegram_bot/helpers.py

16 lines
352 B
Python

"""Helper functions for Telegram bot integration."""
from telegram import Bot
from .const import SIGNAL_UPDATE_EVENT
def signal(bot: Bot) -> str:
"""Define signal name."""
return f"{SIGNAL_UPDATE_EVENT}_{bot.id}"
def get_base_url(bot: Bot) -> str:
"""Return the base URL for the bot."""
return bot.base_url.replace(bot.token, "")