@@ -109,6 +109,7 @@ public static function getInput()
109
109
* @todo Take log verbosity into account
110
110
*
111
111
* @param string $string
112
+ *
112
113
* @return mixed
113
114
*/
114
115
private static function log ($ string )
@@ -129,6 +130,7 @@ private static function log($string)
129
130
* Generate general fake server response
130
131
*
131
132
* @param array $data Data to add to fake response
133
+ *
132
134
* @return array Fake response data
133
135
*/
134
136
public static function generateGeneralFakeServerResponse (array $ data = null )
@@ -167,6 +169,7 @@ public static function generateGeneralFakeServerResponse(array $data = null)
167
169
*
168
170
* @param string $action Action to execute
169
171
* @param array|null $data Data to attach to the execution
172
+ *
170
173
* @return mixed Result of the cURL call
171
174
*/
172
175
public static function executeCurl ($ action , array $ data = null )
@@ -178,7 +181,6 @@ public static function executeCurl($action, array $data = null)
178
181
179
182
$ curlConfig = [
180
183
CURLOPT_URL => 'https://api.telegram.org/bot ' . self ::$ telegram ->getApiKey () . '/ ' . $ action ,
181
- CURLOPT_POST => true ,
182
184
CURLOPT_RETURNTRANSFER => true ,
183
185
CURLOPT_SAFE_UPLOAD => true ,
184
186
];
@@ -227,6 +229,7 @@ public static function executeCurl($action, array $data = null)
227
229
* Download file
228
230
*
229
231
* @param Entities\File $file
232
+ *
230
233
* @return boolean
231
234
*/
232
235
public static function downloadFile (File $ file )
@@ -281,6 +284,7 @@ public static function downloadFile(File $file)
281
284
* Encode file
282
285
*
283
286
* @param string $file
287
+ *
284
288
* @return CURLFile
285
289
*/
286
290
protected static function encodeFile ($ file )
@@ -296,6 +300,7 @@ protected static function encodeFile($file)
296
300
*
297
301
* @param string $action
298
302
* @param array|null $data
303
+ *
299
304
* @return Entities\ServerResponse
300
305
*/
301
306
public static function send ($ action , array $ data = null )
@@ -331,6 +336,7 @@ public static function getMe()
331
336
* @todo Could do with some cleaner recursion
332
337
*
333
338
* @param array $data
339
+ *
334
340
* @return mixed
335
341
*/
336
342
public static function sendMessage (array $ data )
@@ -353,6 +359,7 @@ public static function sendMessage(array $data)
353
359
* Forward message
354
360
*
355
361
* @param array $data
362
+ *
356
363
* @return mixed
357
364
*/
358
365
public static function forwardMessage (array $ data )
@@ -369,6 +376,7 @@ public static function forwardMessage(array $data)
369
376
*
370
377
* @param array $data
371
378
* @param string $file
379
+ *
372
380
* @return mixed
373
381
*/
374
382
public static function sendPhoto (array $ data , $ file = null )
@@ -389,6 +397,7 @@ public static function sendPhoto(array $data, $file = null)
389
397
*
390
398
* @param array $data
391
399
* @param string $file
400
+ *
392
401
* @return mixed
393
402
*/
394
403
public static function sendAudio (array $ data , $ file = null )
@@ -409,6 +418,7 @@ public static function sendAudio(array $data, $file = null)
409
418
*
410
419
* @param array $data
411
420
* @param string $file
421
+ *
412
422
* @return mixed
413
423
*/
414
424
public static function sendDocument (array $ data , $ file = null )
@@ -429,6 +439,7 @@ public static function sendDocument(array $data, $file = null)
429
439
*
430
440
* @param array $data
431
441
* @param string $file
442
+ *
432
443
* @return mixed
433
444
*/
434
445
public static function sendSticker (array $ data , $ file = null )
@@ -449,6 +460,7 @@ public static function sendSticker(array $data, $file = null)
449
460
*
450
461
* @param array $data
451
462
* @param string $file
463
+ *
452
464
* @return mixed
453
465
*/
454
466
public static function sendVideo (array $ data , $ file = null )
@@ -469,6 +481,7 @@ public static function sendVideo(array $data, $file = null)
469
481
*
470
482
* @param array $data
471
483
* @param string $file
484
+ *
472
485
* @return mixed
473
486
*/
474
487
public static function sendVoice (array $ data , $ file = null )
@@ -488,6 +501,7 @@ public static function sendVoice(array $data, $file = null)
488
501
* Send location
489
502
*
490
503
* @param array $data
504
+ *
491
505
* @return mixed
492
506
*/
493
507
public static function sendLocation (array $ data )
@@ -503,6 +517,7 @@ public static function sendLocation(array $data)
503
517
* Send chat action
504
518
*
505
519
* @param array $data
520
+ *
506
521
* @return mixed
507
522
*/
508
523
public static function sendChatAction (array $ data )
@@ -518,6 +533,7 @@ public static function sendChatAction(array $data)
518
533
* Get user profile photos
519
534
*
520
535
* @param array $data
536
+ *
521
537
* @return mixed
522
538
*/
523
539
public static function getUserProfilePhotos (array $ data )
@@ -537,6 +553,7 @@ public static function getUserProfilePhotos(array $data)
537
553
* Get updates
538
554
*
539
555
* @param array $data
556
+ *
540
557
* @return mixed
541
558
*/
542
559
public static function getUpdates (array $ data )
@@ -549,6 +566,7 @@ public static function getUpdates(array $data)
549
566
*
550
567
* @param string $url
551
568
* @param string $file
569
+ *
552
570
* @return mixed
553
571
*/
554
572
public static function setWebhook ($ url = '' , $ file = null )
@@ -566,6 +584,7 @@ public static function setWebhook($url = '', $file = null)
566
584
* Get file
567
585
*
568
586
* @param array $data
587
+ *
569
588
* @return mixed
570
589
*/
571
590
public static function getFile (array $ data )
@@ -581,6 +600,7 @@ public static function getFile(array $data)
581
600
* Answer inline query
582
601
*
583
602
* @param array $data
603
+ *
584
604
* @return mixed
585
605
*/
586
606
public static function answerInlineQuery (array $ data )
@@ -592,6 +612,19 @@ public static function answerInlineQuery(array $data)
592
612
return self ::send ('answerInlineQuery ' , $ data );
593
613
}
594
614
615
+ /**
616
+ * Return an empty Server Response
617
+ *
618
+ * No request to telegram are sent, this function is used in commands that
619
+ * don't need to fire a message after execution
620
+ *
621
+ * @return Entities\ServerResponse
622
+ */
623
+ public static function emptyResponse ()
624
+ {
625
+ return new ServerResponse (['ok ' => true , 'result ' => true ], null );
626
+ }
627
+
595
628
/**
596
629
* Send message to all active chats
597
630
*
@@ -602,6 +635,7 @@ public static function answerInlineQuery(array $data)
602
635
* @param boolean $send_users
603
636
* @param string $date_from
604
637
* @param string $date_to
638
+ *
605
639
* @return array
606
640
*/
607
641
public static function sendToActiveChats (
0 commit comments