-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from tanhongit/refactor-events
(#33) update template message for some events v6
- Loading branch information
Showing
13 changed files
with
127 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = '✅ <b>Pull Request Merged'; | ||
if (!isset($payload->pull_request->merged) || $payload->pull_request->merged !== true) { | ||
$message = '❌ <b>Pull Request Closed'; | ||
} | ||
|
||
$message = $message . "</b> - <a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->pull_request->user->html_url}\">@{$payload->pull_request->user->login}</a>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->pull_request->title}</b> \n\n"; | ||
|
||
if (isset($payload->pull_request->assignee)) { | ||
$message .= "🙋 Assignee: <a href=\"{$payload->pull_request->assignee->html_url}\">@{$payload->pull_request->assignee->login}</a>\n"; | ||
} | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_body.php'; | ||
|
||
echo $message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
if (!empty($payload->pull_request->body)) { | ||
$body = $payload->pull_request->body; | ||
if (strlen($body) > 50) { | ||
$body = substr($body, 0, 50) . '...'; | ||
} | ||
return "📖 <b>Body:</b>\n{$body}"; | ||
} | ||
|
||
return ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = ''; | ||
if (count($payload->pull_request->requested_reviewers) > 0) { | ||
$reviewers = []; | ||
foreach ($payload->pull_request->requested_reviewers as $reviewer) { | ||
$reviewers[] = $reviewer->login; | ||
} | ||
|
||
$message .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n"; | ||
} | ||
|
||
return $message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "👷♂️🛠️ <b>Reopened Pull Request</b> - <a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->pull_request->user->html_url}\">@{$payload->pull_request->user->login}</a>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->pull_request->title}</b> \n\n"; | ||
|
||
if (isset($payload->pull_request->assignee)) { | ||
$message .= "🙋 Assignee: <a href=\"{$payload->pull_request->assignee->html_url}\">@{$payload->pull_request->assignee->login}</a>\n"; | ||
} | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_body.php'; | ||
|
||
echo $message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Thanks for using our bot. | ||
|
||
The bot is designed to send notifications based on GitHub events from your github repo instantly to your Telegram account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<b>Available Commands </b> | ||
|
||
/id - To get chat id. | ||
/host - To get Host Address. | ||
/help - To show this Message. | ||
/usage - How to use me. | ||
|
||
Select a command : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Server Address : <a href="<?= $_SERVER['REMOTE_ADDR'] ?>"><?= $_SERVER['REMOTE_ADDR'] ?></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
/** | ||
* @var $first_name string | ||
*/ | ||
|
||
?> | ||
<b>🙋🏻 <?= config('app.name') ?> 🤓</b> | ||
|
||
Hey <b><?= $first_name ?></b>, | ||
|
||
I can send you notifications from your GitHub Repository instantly to your Telegram. use /help for more information about me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<b>Adding webhook (Website Address) to your GitHub repository</b> | ||
|
||
1) Redirect to <i>Repository Settings->Webhook->Add Webhook</i>. | ||
2) Set your Payload URL. | ||
3) Set content type to "<code>application/x-www-form-urlencoded</code>" | ||
4) Choose events would you like to trigger in this webhook. | ||
|
||
<b>That it. you will receive all notifications through me 🤗</b> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters