File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change 22
33namespace LbilTech \LaravelTelegramGitNotifier \Http \Actions ;
44
5- use LbilTech \TelegramGitNotifier \Services \ WebhookService ;
5+ use LbilTech \TelegramGitNotifier \Webhook ;
66
77class 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}
You can’t perform that action at this time.
0 commit comments