214
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user