Code Duplication    Length = 9-11 lines in 3 locations

src/CoreBot.php 3 locations

@@ 598-607 (lines=10) @@
595
     * - <code>find_location</code> for location data
596
     * @return True on success.
597
     */
598
    public function sendChatAction(string $action) : bool {
599
600
        $parameters = [
601
            'chat_id' => $this->chat_id,
602
            'action' => $action
603
        ];
604
605
        return $this->exec_curl_request($this->api_url . 'sendChatAction?' . http_build_query($parameters));
606
607
    }
608
609
    /**
610
     * \brief Get info about a chat.
@@ 614-622 (lines=9) @@
611
     * \details Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). [Api reference](https://core.telegram.org/bots/api#getchat)
612
     * @param Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)
613
     */
614
    public function getChat($chat_id) {
615
616
        $parameters = [
617
            'chat_id' => $chat_id,
618
        ];
619
620
        return $this->exec_curl_request($this->api_url . 'getChat?' . http_build_query($parameters));
621
622
    }
623
624
    /* \brief Answer a callback query
625
     * \details Remove the updating cirle on an inline keyboard button and showing a message/alert to the user.
@@ 699-709 (lines=11) @@
696
     * $message_id Identifier of the message to edit
697
     * $inline_keyboard Inlike keyboard array (https://core.telegram.org/bots/api#inlinekeyboardmarkup)
698
     */
699
    public function editMessageReplyMarkup($message_id, $inline_keyboard) {
700
701
        $parameters = [
702
            'chat_id' => $this->chat_id,
703
            'message_id' => $message_id,
704
            'reply_markup' => $inline_keyboard,
705
        ];
706
707
        return $this->exec_curl_request($this->api_url . 'editMessageReplyMarkup?' . http_build_query($parameters));
708
709
    }
710
711
    /*
712
     * Answer a inline query (when the user write @botusername "Query") with a button, that will make user switch to the private chat with the bot, on the top of the results (https://core.telegram.org/bots/api#answerinlinequery)