0
I am using the Telegram API to send error logs from my applications.
I display some key information but would also like to display the trace exception. The problem is that Telegram returns an error 400, showing that the value exceeds the maximum size (which is 4096, if I’m not mistaken).
In case, I wanted to continue displaying the key log information and add that snippet from trace exception (which is large) in a file txt.
It would be possible, in addition to sending the message, to attach a text file together?
The code I have is this::
function telegram_log($chat_id, $text, $parse_mode = 'markdown')
{
$cli = new \GuzzleHttp\Client([
'base_url' => TELEGRAM_URL_API,
]);
$response = $cli->post('sendMessage', [
'query' => compact('text', 'parse_mode', 'chat_id'),
'timeout' => 5,
'connect_timeout' => 5,
]);
return json_decode( (string) $response->getBody() );
}
In that SOEN response the guy uses the parameter
captionofsendDocument. But I don’t know if it helps you because it has 200 limit characters and I don’t know what caption looks like in the Apps.– fernandosavio
@fernandosavio boa.
– Wallace Maxters