.
This commit is contained in:
parent
f4f3c43128
commit
4d31d39599
30
main.py
30
main.py
@ -916,11 +916,22 @@ async def handle_issue_comment(payload: dict[str, Any]) -> None:
|
|||||||
if not repo_full_name or not pr_number:
|
if not repo_full_name or not pr_number:
|
||||||
return
|
return
|
||||||
msg = f"Новый комментарий в PR {repo_full_name}#{pr_number}: {body}"
|
msg = f"Новый комментарий в PR {repo_full_name}#{pr_number}: {body}"
|
||||||
for chat_id in await get_pr_participant_chat_ids(
|
recipient_chat_ids = await get_pr_participant_chat_ids(
|
||||||
repo_full_name,
|
repo_full_name,
|
||||||
int(pr_number),
|
int(pr_number),
|
||||||
exclude_login=commenter_login,
|
exclude_login=commenter_login,
|
||||||
):
|
)
|
||||||
|
if not recipient_chat_ids:
|
||||||
|
log_warn(
|
||||||
|
f"[notify] issue_comment без получателей для {repo_full_name}#{pr_number}. "
|
||||||
|
f"commenter={commenter_login}"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
log_info(
|
||||||
|
f"[notify] issue_comment для {repo_full_name}#{pr_number}, "
|
||||||
|
f"commenter={commenter_login}, получателей={len(recipient_chat_ids)}"
|
||||||
|
)
|
||||||
|
for chat_id in recipient_chat_ids:
|
||||||
await telegram_client.send_message(chat_id, msg)
|
await telegram_client.send_message(chat_id, msg)
|
||||||
|
|
||||||
|
|
||||||
@ -936,12 +947,23 @@ async def handle_pull_request_comment(payload: dict[str, Any]) -> None:
|
|||||||
if not repo_full_name or not pr_number or not body:
|
if not repo_full_name or not pr_number or not body:
|
||||||
return
|
return
|
||||||
msg = f"Новый комментарий в PR {repo_full_name}#{pr_number}: {body}"
|
msg = f"Новый комментарий в PR {repo_full_name}#{pr_number}: {body}"
|
||||||
for chat_id in await get_pr_participant_chat_ids(
|
recipient_chat_ids = await get_pr_participant_chat_ids(
|
||||||
repo_full_name,
|
repo_full_name,
|
||||||
int(pr_number),
|
int(pr_number),
|
||||||
pull_request=pull_request,
|
pull_request=pull_request,
|
||||||
exclude_login=commenter_login,
|
exclude_login=commenter_login,
|
||||||
):
|
)
|
||||||
|
if not recipient_chat_ids:
|
||||||
|
log_warn(
|
||||||
|
f"[notify] pull_request_comment без получателей для {repo_full_name}#{pr_number}. "
|
||||||
|
f"commenter={commenter_login}"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
log_info(
|
||||||
|
f"[notify] pull_request_comment для {repo_full_name}#{pr_number}, "
|
||||||
|
f"commenter={commenter_login}, получателей={len(recipient_chat_ids)}"
|
||||||
|
)
|
||||||
|
for chat_id in recipient_chat_ids:
|
||||||
await telegram_client.send_message(chat_id, msg)
|
await telegram_client.send_message(chat_id, msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user