Code Duplication    Length = 14-15 lines in 2 locations

src/CoreBot.php 2 locations

@@ 632-646 (lines=15) @@
629
     * @param $reply_to_message_id <i>Optional</i>. If the message is a reply, ID of the original message.
630
     * @return On success, the sent message is returned.
631
     */
632
    public function sendVoice($voice, string $caption, int $duration, string $reply_markup = null, bool $disable_notification, int $reply_to_message_id = 0) {
633
634
        $parameters = [
635
            'chat_id' => $this->_chat_id,
636
            'voice' => $voice,
637
            'caption' => $caption,
638
            'duration' => $duration,
639
            'disable_notification', $disable_notification,
640
            'reply_to_message_id' => $reply_to_message_id,
641
            'reply_markup' => $reply_markup
642
        ];
643
644
        return $this->exec_curl_request('sendVoice?' . http_build_query($parameters));
645
646
    }
647
648
    /**
649
     * \brief Say the user what action is the bot doing.
@@ 739-752 (lines=14) @@
736
     * @param $parse_mode <i>Optional</i>. Send Markdown or HTML.
737
     * @param $disable_web_preview <i>Optional</i>. Disables link previews for links in this message.
738
     */
739
    public function editMessageText(int $message_id, $text, $reply_markup = null, string $parse_mode = 'HTML', bool $disable_web_preview = true) {
740
741
        $parameters = [
742
            'chat_id' => $this->_chat_id,
743
            'message_id' => $message_id,
744
            'text' => $text,
745
            'reply_markup' => $reply_markup,
746
            'parse_mode' => $parse_mode,
747
            'disable_web_page_preview' => $disable_web_preview,
748
        ];
749
750
        return $this->exec_curl_request('editMessageText?' . http_build_query($parameters));
751
752
    }
753
754
    /**
755
     * \brief Edit text of a message sent via the bot.