| @@ 375-386 (lines=12) @@ | ||
| 372 | * @return mixed |
|
| 373 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 374 | */ |
|
| 375 | public static function sendPhoto(array $data, $file = null) |
|
| 376 | { |
|
| 377 | if (empty($data)) { |
|
| 378 | throw new TelegramException('Data is empty!'); |
|
| 379 | } |
|
| 380 | ||
| 381 | if (!is_null($file)) { |
|
| 382 | $data['photo'] = self::encodeFile($file); |
|
| 383 | } |
|
| 384 | ||
| 385 | return self::send('sendPhoto', $data); |
|
| 386 | } |
|
| 387 | ||
| 388 | /** |
|
| 389 | * Send audio |
|
| @@ 397-408 (lines=12) @@ | ||
| 394 | * @return mixed |
|
| 395 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 396 | */ |
|
| 397 | public static function sendAudio(array $data, $file = null) |
|
| 398 | { |
|
| 399 | if (empty($data)) { |
|
| 400 | throw new TelegramException('Data is empty!'); |
|
| 401 | } |
|
| 402 | ||
| 403 | if (!is_null($file)) { |
|
| 404 | $data['audio'] = self::encodeFile($file); |
|
| 405 | } |
|
| 406 | ||
| 407 | return self::send('sendAudio', $data); |
|
| 408 | } |
|
| 409 | ||
| 410 | /** |
|
| 411 | * Send document |
|
| @@ 419-430 (lines=12) @@ | ||
| 416 | * @return mixed |
|
| 417 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 418 | */ |
|
| 419 | public static function sendDocument(array $data, $file = null) |
|
| 420 | { |
|
| 421 | if (empty($data)) { |
|
| 422 | throw new TelegramException('Data is empty!'); |
|
| 423 | } |
|
| 424 | ||
| 425 | if (!is_null($file)) { |
|
| 426 | $data['document'] = self::encodeFile($file); |
|
| 427 | } |
|
| 428 | ||
| 429 | return self::send('sendDocument', $data); |
|
| 430 | } |
|
| 431 | ||
| 432 | /** |
|
| 433 | * Send sticker |
|
| @@ 441-452 (lines=12) @@ | ||
| 438 | * @return mixed |
|
| 439 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 440 | */ |
|
| 441 | public static function sendSticker(array $data, $file = null) |
|
| 442 | { |
|
| 443 | if (empty($data)) { |
|
| 444 | throw new TelegramException('Data is empty!'); |
|
| 445 | } |
|
| 446 | ||
| 447 | if (!is_null($file)) { |
|
| 448 | $data['sticker'] = self::encodeFile($file); |
|
| 449 | } |
|
| 450 | ||
| 451 | return self::send('sendSticker', $data); |
|
| 452 | } |
|
| 453 | ||
| 454 | /** |
|
| 455 | * Send video |
|
| @@ 463-474 (lines=12) @@ | ||
| 460 | * @return mixed |
|
| 461 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 462 | */ |
|
| 463 | public static function sendVideo(array $data, $file = null) |
|
| 464 | { |
|
| 465 | if (empty($data)) { |
|
| 466 | throw new TelegramException('Data is empty!'); |
|
| 467 | } |
|
| 468 | ||
| 469 | if (!is_null($file)) { |
|
| 470 | $data['video'] = self::encodeFile($file); |
|
| 471 | } |
|
| 472 | ||
| 473 | return self::send('sendVideo', $data); |
|
| 474 | } |
|
| 475 | ||
| 476 | /** |
|
| 477 | * Send voice |
|
| @@ 485-496 (lines=12) @@ | ||
| 482 | * @return mixed |
|
| 483 | * @throws \Longman\TelegramBot\Exception\TelegramException |
|
| 484 | */ |
|
| 485 | public static function sendVoice(array $data, $file = null) |
|
| 486 | { |
|
| 487 | if (empty($data)) { |
|
| 488 | throw new TelegramException('Data is empty!'); |
|
| 489 | } |
|
| 490 | ||
| 491 | if (!is_null($file)) { |
|
| 492 | $data['voice'] = self::encodeFile($file); |
|
| 493 | } |
|
| 494 | ||
| 495 | return self::send('sendVoice', $data); |
|
| 496 | } |
|
| 497 | ||
| 498 | /** |
|
| 499 | * Send location |
|