{"record":{"id":"23ad66811ba3e8f4","repo":"Seldaek/monolog","slug":"the-curl-extension-is-needed-to-use-the-telegrambo","errorCode":null,"errorMessage":"The curl extension is needed to use the TelegramBotHandler","messagePattern":"The curl extension is needed to use the TelegramBotHandler","errorType":"exception","errorClass":"MissingExtensionException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/TelegramBotHandler.php","lineNumber":122,"sourceCode":"     * @param  bool                      $splitLongMessages    Split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages\n     * @param  bool                      $delayBetweenMessages Adds delay between sending a split message according to Telegram API\n     * @param  int                       $topic                Telegram message thread id, unique identifier for the target message thread (topic) of the forum\n     * @throws MissingExtensionException If the curl extension is missing\n     */\n    public function __construct(\n        string $apiKey,\n        string $channel,\n        $level = Level::Debug,\n        bool   $bubble = true,\n        ?string $parseMode = null,\n        ?bool   $disableWebPagePreview = null,\n        ?bool   $disableNotification = null,\n        bool   $splitLongMessages = false,\n        bool   $delayBetweenMessages = false,\n        ?int   $topic = null\n    ) {\n        if (!\\extension_loaded('curl')) {\n            throw new MissingExtensionException('The curl extension is needed to use the TelegramBotHandler');\n        }\n\n        parent::__construct($level, $bubble);\n\n        $this->apiKey = $apiKey;\n        $this->channel = $channel;\n        $this->setParseMode($parseMode);\n        $this->disableWebPagePreview($disableWebPagePreview);\n        $this->disableNotification($disableNotification);\n        $this->splitLongMessages($splitLongMessages);\n        $this->delayBetweenMessages($delayBetweenMessages);\n        $this->setTopic($topic);\n    }\n\n    /**\n     * @return $this\n     */\n    public function setParseMode(string|null $parseMode = null): self","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/TelegramBotHandler.php#L104-L140","documentation":"Error \"The curl extension is needed to use the TelegramBotHandler\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/TelegramBotHandler.php:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}