Total Complexity | 3 |
Total Lines | 69 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Webhook extends Model |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $method; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $url; |
||
17 | |||
18 | /** |
||
19 | * @var |
||
20 | */ |
||
21 | protected $certificate; |
||
22 | |||
23 | /** |
||
24 | * @var integer |
||
25 | */ |
||
26 | protected $max_connections; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $allowed_updates; |
||
32 | |||
33 | /** |
||
34 | * HTTPS url to send updates to. |
||
35 | * Use an empty string to remove webhook integration |
||
36 | * |
||
37 | * @param string $url |
||
38 | * @return array |
||
39 | * @throws \LeoCarmo\TelegramBot\Exceptions\RequiredParameterException |
||
40 | */ |
||
41 | public function set(string $url) |
||
42 | { |
||
43 | $this->url = $url; |
||
44 | |||
45 | $this->method = 'setWebhook'; |
||
46 | |||
47 | return $this->send(); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Use this method to remove webhook integration if you decide to switch back to getUpdates |
||
52 | * |
||
53 | * @return array |
||
54 | * @throws \LeoCarmo\TelegramBot\Exceptions\RequiredParameterException |
||
55 | */ |
||
56 | public function delete() |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Use this method to get current webhook status |
||
65 | * |
||
66 | * @return array |
||
67 | * @throws \LeoCarmo\TelegramBot\Exceptions\RequiredParameterException |
||
68 | */ |
||
69 | public function get() |
||
76 | } |