Code Duplication    Length = 23-23 lines in 2 locations

src/BotApi.php 2 locations

@@ 654-676 (lines=23) @@
651
     * @throws \TelegramBot\Api\InvalidArgumentException
652
     * @throws \TelegramBot\Api\Exception
653
     */
654
    public function sendVideo(
655
        $chatId,
656
        $video,
657
        $duration = null,
658
        $caption = null,
659
        $replyToMessageId = null,
660
        $replyMarkup = null,
661
        $disableNotification = false,
662
        $supportsStreaming = false,
663
        $parseMode = null
664
    ) {
665
        return Message::fromResponse($this->call('sendVideo', [
666
            'chat_id' => $chatId,
667
            'video' => $video,
668
            'duration' => $duration,
669
            'caption' => $caption,
670
            'reply_to_message_id' => $replyToMessageId,
671
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
672
            'disable_notification' => (bool)$disableNotification,
673
            'supports_streaming' => (bool)$supportsStreaming,
674
            'parse_mode' => $parseMode
675
        ]));
676
    }
677
678
    /**
679
     * Use this method to send audio files,
@@ 772-794 (lines=23) @@
769
     * @throws \TelegramBot\Api\InvalidArgumentException
770
     * @throws \TelegramBot\Api\Exception
771
     */
772
    public function sendAudio(
773
        $chatId,
774
        $audio,
775
        $duration = null,
776
        $performer = null,
777
        $title = null,
778
        $replyToMessageId = null,
779
        $replyMarkup = null,
780
        $disableNotification = false,
781
        $parseMode = null
782
    ) {
783
        return Message::fromResponse($this->call('sendAudio', [
784
            'chat_id' => $chatId,
785
            'audio' => $audio,
786
            'duration' => $duration,
787
            'performer' => $performer,
788
            'title' => $title,
789
            'reply_to_message_id' => $replyToMessageId,
790
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
791
            'disable_notification' => (bool)$disableNotification,
792
            'parse_mode' => $parseMode
793
        ]));
794
    }
795
796
    /**
797
     * Use this method to send photos. On success, the sent Message is returned.