extend hooks for key creation

This commit is contained in:
Capybara-z
2025-09-19 12:13:04 +03:00
parent 81751093d9
commit c424c41048
2 changed files with 24 additions and 0 deletions
@@ -177,6 +177,18 @@ async def key_cluster_mode(
builder.row(InlineKeyboardButton(text=SUPPORT, url=SUPPORT_CHAT_URL))
builder.row(InlineKeyboardButton(text=MAIN_MENU, callback_data="profile"))
try:
intercept_results = await run_hooks(
"intercept_key_creation_message",
chat_id=tg_id,
session=session,
target_message=target_message
)
if intercept_results and intercept_results[0]:
return
except Exception as e:
logger.warning(f"[INTERCEPT_KEY_CREATION] Ошибка при применении хуков: {e}")
try:
hook_commands = await run_hooks(
"key_creation_complete", chat_id=tg_id, admin=False, session=session, email=email, key_name=key_name
@@ -519,6 +519,18 @@ async def finalize_key_creation(
builder.row(InlineKeyboardButton(text=SUPPORT, url=SUPPORT_CHAT_URL))
builder.row(InlineKeyboardButton(text=MAIN_MENU, callback_data="profile"))
try:
intercept_results = await run_hooks(
"intercept_key_creation_message",
chat_id=tg_id,
session=session,
target_message=callback_query.message
)
if intercept_results and intercept_results[0]:
return
except Exception as e:
logger.warning(f"[INTERCEPT_KEY_CREATION] Ошибка при применении хуков: {e}")
try:
hook_commands = await run_hooks(
"key_creation_complete", chat_id=tg_id, admin=False, session=session, email=email, key_name=key_name