@@ -187,7 +187,7 @@ public function validateSecret(bool $force = false): self
187187 public function validateAndSetWebhook (): self
188188 {
189189 $ webhook = $ this ->params ->getBotParam ('webhook ' );
190- if (empty ($ webhook ) && $ this ->action ->isAction (['set ' , 'reset ' ])) {
190+ if (empty ($ webhook[ ' url ' ] ?? null ) && $ this ->action ->isAction (['set ' , 'reset ' ])) {
191191 throw new InvalidWebhookException ('Invalid webhook ' );
192192 }
193193
@@ -199,14 +199,14 @@ public function validateAndSetWebhook(): self
199199
200200 if ($ this ->action ->isAction (['set ' , 'reset ' ])) {
201201 $ webhook_params = array_filter ([
202- 'certificate ' => $ this -> params -> getBotParam ( 'certificate ' ) ,
203- 'max_connections ' => $ this -> params -> getBotParam ( 'max_connections ' ) ,
204- 'allowed_updates ' => $ this -> params -> getBotParam ( 'allowed_updates ' ) ,
202+ 'certificate ' => $ webhook [ 'certificate ' ] ?? null ,
203+ 'max_connections ' => $ webhook [ 'max_connections ' ] ?? null ,
204+ 'allowed_updates ' => $ webhook [ 'allowed_updates ' ] ?? null ,
205205 ]);
206206
207207 $ this ->handleOutput (
208208 $ this ->telegram ->setWebhook (
209- $ webhook . '?a=handle&s= ' . $ this ->params ->getBotParam ('secret ' ),
209+ $ webhook[ ' url ' ] . '?a=handle&s= ' . $ this ->params ->getBotParam ('secret ' ),
210210 $ webhook_params
211211 )->getDescription () . PHP_EOL
212212 );
@@ -324,7 +324,7 @@ protected function setBotExtrasRequest(): self
324324 */
325325 public function handleRequest (): self
326326 {
327- if (empty ($ this ->params ->getBotParam ('webhook ' ))) {
327+ if (empty ($ this ->params ->getBotParam ('webhook.url ' ))) {
328328 if ($ loop_time = $ this ->getLoopTime ()) {
329329 $ this ->handleGetUpdatesLoop ($ loop_time , $ this ->getLoopInterval ());
330330 } else {
0 commit comments