From 857284b6a3a63d43c58af82fe962d16ac7786dd9 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Wed, 28 Jun 2023 23:52:54 +0700 Subject: [PATCH] (#33) edit conditions to check empty chat ids & add new templates --- resources/events/pull_request_review/dismissed.php | 12 ++++++++++++ resources/events/pull_request_review/submitted.php | 12 ++++++++++++ src/Http/Actions/SendNotifyAction.php | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 resources/events/pull_request_review/dismissed.php create mode 100644 resources/events/pull_request_review/submitted.php diff --git a/resources/events/pull_request_review/dismissed.php b/resources/events/pull_request_review/dismissed.php new file mode 100644 index 0000000..f9b0f72 --- /dev/null +++ b/resources/events/pull_request_review/dismissed.php @@ -0,0 +1,12 @@ +Dismissed Pull Request Review Comment - pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by review->user->html_url}\">@{$payload->review->user->login}\n\n"; + +$message .= "🛠 {$payload->pull_request->title} \n\n"; + +$message .= "🔗 Link: review->html_url}\">{$payload->review->html_url}\n\n"; + +echo $message; diff --git a/resources/events/pull_request_review/submitted.php b/resources/events/pull_request_review/submitted.php new file mode 100644 index 0000000..3a152c6 --- /dev/null +++ b/resources/events/pull_request_review/submitted.php @@ -0,0 +1,12 @@ +New Pull Request Review Comment - pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by review->user->html_url}\">@{$payload->review->user->login}\n\n"; + +$message .= "🛠 {$payload->pull_request->title} \n\n"; + +$message .= "🔗 Link: review->html_url}\">{$payload->review->html_url}\n\n"; + +echo $message; diff --git a/src/Http/Actions/SendNotifyAction.php b/src/Http/Actions/SendNotifyAction.php index 47e41c4..5eb53ab 100644 --- a/src/Http/Actions/SendNotifyAction.php +++ b/src/Http/Actions/SendNotifyAction.php @@ -55,7 +55,7 @@ public function __invoke(): void if (!is_null($this->request->server->get('HTTP_X_GITHUB_EVENT')) && empty($chatMessageId)) { $this->notificationService->setPayload($this->request); foreach ($this->chatIds as $chatId) { - if (empty($chatId) || !$this->telegramService->telegram->getChatMember($chatId)) { + if (empty($chatId)) { continue; }