Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

@@ 841-845 (lines=5) @@
838
    {
839
        $result = Request::deleteWebhook();
840
841
        if (!$result->isOk()) {
842
            throw new TelegramException(
843
                'Webhook was not deleted! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
844
            );
845
        }
846
847
        return $result;
848
    }
@@ 822-826 (lines=5) @@
819
820
        $result = Request::setWebhook($data);
821
822
        if (!$result->isOk()) {
823
            throw new TelegramException(
824
                'Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
825
            );
826
        }
827
828
        return $result;
829
    }