Skip to content

Commit

Permalink
(#33) update messages for pull_request event
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jun 28, 2023
1 parent 25a8ac7 commit 47b4771
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Requirement

- PHP ^7.2|^8.0
- PHP ^8.0
- Composer
- Telegram Bot

Expand Down
8 changes: 4 additions & 4 deletions resources/events/pull_request/partials/_reviewers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* @var $payload mixed
*/

$message = '';
if (count($payload->pull_request->requested_reviewers) > 0) {
$textReviewers = '';
if (isset($payload->pull_request->requested_reviewers) && count($payload->pull_request->requested_reviewers) > 0) {
$reviewers = [];
foreach ($payload->pull_request->requested_reviewers as $reviewer) {
$reviewers[] = $reviewer->login;
}

$message .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n";
$textReviewers .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n";
}

return $message;
return $textReviewers;

0 comments on commit 47b4771

Please sign in to comment.