Skip to content

Commit

Permalink
(#33) edit conditions to check empty chat ids & add new templates
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jun 28, 2023
1 parent 3d0013c commit 857284b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions resources/events/pull_request_review/dismissed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* @var $payload mixed
*/

$message = "👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> - <a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->review->user->html_url}\">@{$payload->review->user->login}</a>\n\n";

$message .= "🛠 <b>{$payload->pull_request->title}</b> \n\n";

$message .= "🔗 Link: <a href=\"{$payload->review->html_url}\">{$payload->review->html_url}</a>\n\n";

echo $message;
12 changes: 12 additions & 0 deletions resources/events/pull_request_review/submitted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* @var $payload mixed
*/

$message = "👷‍♂️🛠️ <b>New Pull Request Review Comment</b> - <a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->review->user->html_url}\">@{$payload->review->user->login}</a>\n\n";

$message .= "🛠 <b>{$payload->pull_request->title}</b> \n\n";

$message .= "🔗 Link: <a href=\"{$payload->review->html_url}\">{$payload->review->html_url}</a>\n\n";

echo $message;
2 changes: 1 addition & 1 deletion src/Http/Actions/SendNotifyAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 857284b

Please sign in to comment.