Code Duplication    Length = 23-23 lines in 2 locations

src/BotApi.php 2 locations

@@ 667-689 (lines=23) @@
664
     * @throws \TelegramBot\Api\InvalidArgumentException
665
     * @throws \TelegramBot\Api\Exception
666
     */
667
    public function sendVideo(
668
        $chatId,
669
        $video,
670
        $duration = null,
671
        $caption = null,
672
        $replyToMessageId = null,
673
        $replyMarkup = null,
674
        $disableNotification = false,
675
        $supportsStreaming = false,
676
        $parseMode = null
677
    ) {
678
        return Message::fromResponse($this->call('sendVideo', [
679
            'chat_id' => $chatId,
680
            'video' => $video,
681
            'duration' => $duration,
682
            'caption' => $caption,
683
            'reply_to_message_id' => $replyToMessageId,
684
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
685
            'disable_notification' => (bool)$disableNotification,
686
            'supports_streaming' => (bool)$supportsStreaming,
687
            'parse_mode' => $parseMode
688
        ]));
689
    }
690
691
    /**
692
     * Use this method to send audio files,
@@ 785-807 (lines=23) @@
782
     * @throws \TelegramBot\Api\InvalidArgumentException
783
     * @throws \TelegramBot\Api\Exception
784
     */
785
    public function sendAudio(
786
        $chatId,
787
        $audio,
788
        $duration = null,
789
        $performer = null,
790
        $title = null,
791
        $replyToMessageId = null,
792
        $replyMarkup = null,
793
        $disableNotification = false,
794
        $parseMode = null
795
    ) {
796
        return Message::fromResponse($this->call('sendAudio', [
797
            'chat_id' => $chatId,
798
            'audio' => $audio,
799
            'duration' => $duration,
800
            'performer' => $performer,
801
            'title' => $title,
802
            'reply_to_message_id' => $replyToMessageId,
803
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
804
            'disable_notification' => (bool)$disableNotification,
805
            'parse_mode' => $parseMode
806
        ]));
807
    }
808
809
    /**
810
     * Use this method to send photos. On success, the sent Message is returned.