Skip to content

Commit

Permalink
(#33) update template message for some events v7
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jun 28, 2023
1 parent 47b4771 commit 99778af
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
10 changes: 10 additions & 0 deletions resources/events/watch/started.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* @var $payload mixed
*/

$message = "🎉 <b>Watch Started</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n";

$message .= "👤 Watcher: <b>{$payload->sender->login}</b> 👀\n\n";

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

$message = "🎉 <b>Action Queued</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n";

$message .= "Queued action: 💥 <b>{$payload->workflow_job->runner_name}</b> ⏰\n\n";

$message .= "🔗 Link: <a href=\"{$payload->workflow_job->html_url}\">{$payload->workflow_job->html_url}</a>\n\n";
4 changes: 2 additions & 2 deletions resources/events/workflow_run/completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @var $payload mixed
*/

$message = "🎉 <b>Workflow Completed</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a>\n\n";
$message = "🎉 <b>Workflow Completed</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n";

$message .= "Done workflow: 🎉 <b>{$payload->workflow_run->name}</b> ✨ \n\n";

$message .= "📤 Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n";
// $message .= "📤 Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n";

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

Expand Down
4 changes: 2 additions & 2 deletions resources/events/workflow_run/requested.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @var $payload mixed
*/

$message = "🔧 <b>Workflow Requested</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a>\n\n";
$message = "🔧 <b>Workflow Requested</b> from <a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n";

$message .= "Running workflow: 💥 <b>{$payload->workflow_run->name}</b> ⏳\n\n";

$message .= "📤 Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n";
// $message .= "📤 Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n";

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

Expand Down
3 changes: 3 additions & 0 deletions resources/globals/access_denied.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
🔒 <b>Access Denied to Bot </b>🚫

Please contact administrator for further information, Thank You..
2 changes: 1 addition & 1 deletion src/Services/NotificationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NotificationService
*/
public function accessDenied(TelegramService $telegramService): void
{
$reply = "🔒 <b>Access Denied to Bot </b>🚫\n\nPlease contact administrator for further information, Thank You..";
$reply = get_template('globals.access_denied');
$content = array(
'chat_id' => $telegramService->chatId,
'text' => $reply,
Expand Down

0 comments on commit 99778af

Please sign in to comment.