Skip to content

Commit 2b370dd

Browse files
committed
update webhook follow core
1 parent 57cabc9 commit 2b370dd

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/Http/Actions/WebhookAction.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,48 @@
22

33
namespace LbilTech\LaravelTelegramGitNotifier\Http\Actions;
44

5-
use LbilTech\TelegramGitNotifier\Services\WebhookService;
5+
use LbilTech\TelegramGitNotifier\Webhook;
66

77
class WebhookAction
88
{
99
protected string $token;
1010

11-
protected WebhookService $webhookService;
11+
protected Webhook $webhook;
1212

13-
public function __construct(WebhookService $webhookService)
13+
public function __construct()
1414
{
15-
$this->webhookService = $webhookService;
16-
$this->webhookService->setToken(config('telegram-git-notifier.bot.token'));
17-
$this->webhookService->setUrl(config('telegram-git-notifier.app.url'));
15+
$this->webhook = new Webhook();
16+
$this->webhook->setToken(config('telegram-git-notifier.bot.token'));
17+
$this->webhook->setUrl(config('telegram-git-notifier.app.url'));
1818
}
1919

2020
/**
21-
* Set webhook for telegram bot.
21+
* Set webhook for telegram bot
2222
*
2323
* @return false|string
2424
*/
2525
public function set(): false|string
2626
{
27-
return $this->webhookService->setWebhook();
27+
return $this->webhook->setWebhook();
2828
}
2929

3030
/**
31-
* Delete webhook for telegram bot.
31+
* Delete webhook for telegram bot
3232
*
3333
* @return false|string
3434
*/
3535
public function delete(): false|string
3636
{
37-
return $this->webhookService->deleteWebHook();
37+
return $this->webhook->deleteWebHook();
38+
}
39+
40+
/**
41+
* Get webhook update
42+
*
43+
* @return false|string
44+
*/
45+
public function getUpdates(): false|string
46+
{
47+
return $this->webhook->getUpdates();
3848
}
3949
}

0 commit comments

Comments
 (0)