22
33namespace CSlant \LaravelTelegramGitNotifier \Http \Actions ;
44
5+ use CSlant \LaravelTelegramGitNotifier \Services \WebhookService ;
56use CSlant \TelegramGitNotifier \Exceptions \WebhookException ;
6- use CSlant \TelegramGitNotifier \Webhook ;
77
88class WebhookAction
99{
10- protected Webhook $ webhook ;
10+ protected WebhookService $ webhookService ;
1111
1212 public function __construct ()
1313 {
14- $ this ->webhook = new Webhook ();
15- $ this ->webhook ->setToken (config ('telegram-git-notifier.bot.token ' ));
16- $ this ->webhook ->setUrl (config ('telegram-git-notifier.app.url ' ));
14+ $ this ->webhookService = new WebhookService ();
1715 }
1816
1917 /**
@@ -25,7 +23,7 @@ public function __construct()
2523 */
2624 public function set (): string
2725 {
28- return $ this ->webhook ->setWebhook ();
26+ return $ this ->webhookService ->setWebhook ();
2927 }
3028
3129 /**
@@ -37,7 +35,7 @@ public function set(): string
3735 */
3836 public function delete (): string
3937 {
40- return $ this ->webhook ->deleteWebHook ();
38+ return $ this ->webhookService ->deleteWebHook ();
4139 }
4240
4341 /**
@@ -49,7 +47,7 @@ public function delete(): string
4947 */
5048 public function getUpdates (): string
5149 {
52- return $ this ->webhook ->getUpdates ();
50+ return $ this ->webhookService ->getUpdates ();
5351 }
5452
5553 /**
@@ -61,6 +59,6 @@ public function getUpdates(): string
6159 */
6260 public function getWebHookInfo (): string
6361 {
64- return $ this ->webhook ->getWebHookInfo ();
62+ return $ this ->webhookService ->getWebHookInfo ();
6563 }
6664}
0 commit comments