214
Some checks failed
CI / Lint (ruff + mypy) (push) Failing after 32s
CI / Run tests (push) Has been skipped
CI / Docker build test (push) Successful in 11s

This commit is contained in:
2026-04-02 22:03:20 +07:00
parent 8be26418b1
commit ddebe03f15
3 changed files with 82 additions and 56 deletions

View File

@@ -205,13 +205,32 @@ async def show_actor_status_menu(callback: CallbackQuery, actor: dict[str, Any],
async def update_channel_post(bot: Bot, app_config: dict, state_storage: JsonStateStorage, settings) -> None:
state = state_storage.load()
text = build_channel_text(app_config, state)
await bot.edit_message_text(
chat_id=settings.channel_id,
message_id=settings.channel_message_id,
text=text,
parse_mode=ParseMode.HTML,
disable_web_page_preview=False,
)
try:
await bot.edit_message_text(
chat_id=settings.channel_id,
message_id=settings.channel_message_id,
text=text,
parse_mode=ParseMode.HTML,
disable_web_page_preview=False,
)
except TelegramBadRequest as exc:
if "Invalid custom emoji identifier specified" not in str(exc):
raise
template = state.get("template", {}).get("text", "")
if not template:
raise
state["template"]["text"] = sanitize_template_html(template)
state_storage.save(state)
fallback_text = build_channel_text(app_config, state)
await bot.edit_message_text(
chat_id=settings.channel_id,
message_id=settings.channel_message_id,
text=fallback_text,
parse_mode=ParseMode.HTML,
disable_web_page_preview=False,
)
async def apply_status_update(