Code Duplication    Length = 14-15 lines in 2 locations

src/CoreBot.php 2 locations

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