2
2
3
3
namespace CSlant \LaravelTelegramGitNotifier \Http \Actions ;
4
4
5
+ use CSlant \LaravelTelegramGitNotifier \Services \WebhookService ;
5
6
use CSlant \TelegramGitNotifier \Exceptions \WebhookException ;
6
- use CSlant \TelegramGitNotifier \Webhook ;
7
7
8
8
class WebhookAction
9
9
{
10
- protected Webhook $ webhook ;
10
+ protected WebhookService $ webhookService ;
11
11
12
12
public function __construct ()
13
13
{
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 ();
17
15
}
18
16
19
17
/**
@@ -25,7 +23,7 @@ public function __construct()
25
23
*/
26
24
public function set (): string
27
25
{
28
- return $ this ->webhook ->setWebhook ();
26
+ return $ this ->webhookService ->setWebhook ();
29
27
}
30
28
31
29
/**
@@ -37,7 +35,7 @@ public function set(): string
37
35
*/
38
36
public function delete (): string
39
37
{
40
- return $ this ->webhook ->deleteWebHook ();
38
+ return $ this ->webhookService ->deleteWebHook ();
41
39
}
42
40
43
41
/**
@@ -49,7 +47,7 @@ public function delete(): string
49
47
*/
50
48
public function getUpdates (): string
51
49
{
52
- return $ this ->webhook ->getUpdates ();
50
+ return $ this ->webhookService ->getUpdates ();
53
51
}
54
52
55
53
/**
@@ -61,6 +59,6 @@ public function getUpdates(): string
61
59
*/
62
60
public function getWebHookInfo (): string
63
61
{
64
- return $ this ->webhook ->getWebHookInfo ();
62
+ return $ this ->webhookService ->getWebHookInfo ();
65
63
}
66
64
}
0 commit comments