Code Duplication    Length = 14-15 lines in 2 locations

src/CoreBot.php 2 locations

@@ 607-621 (lines=15) @@
604
     * @param $reply_to_message_id <i>Optional</i>. If the message is a reply, ID of the original message.
605
     * @return On success, the sent message is returned.
606
     */
607
    public function sendVoice($voice, string $caption, int $duration, string $reply_markup = null, bool $disable_notification, int $reply_to_message_id = 0) {
608
609
        $parameters = [
610
            'chat_id' => $this->_chat_id,
611
            'voice' => $voice,
612
            'caption' => $caption,
613
            'duration' => $duration,
614
            'disable_notification', $disable_notification,
615
            'reply_to_message_id' => $reply_to_message_id,
616
            'reply_markup' => $reply_markup
617
        ];
618
619
        return $this->exec_curl_request($this->_api_url . 'sendVoice?' . http_build_query($parameters));
620
621
    }
622
623
    /**
624
     * \brief Say the user what action is the bot doing.
@@ 714-727 (lines=14) @@
711
     * @param $parse_mode <i>Optional</i>. Send Markdown or HTML.
712
     * @param $disable_web_preview <i>Optional</i>. Disables link previews for links in this message.
713
     */
714
    public function editMessageText(int $message_id, $text, $reply_markup = null, string $parse_mode = 'HTML', bool $disable_web_preview = true) {
715
716
        $parameters = [
717
            'chat_id' => $this->_chat_id,
718
            'message_id' => $message_id,
719
            'text' => $text,
720
            'reply_markup' => $reply_markup,
721
            'parse_mode' => $parse_mode,
722
            'disable_web_page_preview' => $disable_web_preview,
723
        ];
724
725
        return $this->exec_curl_request($this->_api_url . 'editMessageText?' . http_build_query($parameters));
726
727
    }
728
729
    /**
730
     * \brief Edit text of a message sent via the bot.