\hypertarget{_async_telegram2_8cpp_source}{}\doxysection{Async\+Telegram2.\+cpp}
\label{_async_telegram2_8cpp_source}\index{src/AsyncTelegram2.cpp@{src/AsyncTelegram2.cpp}}
\mbox{\hyperlink{_async_telegram2_8cpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00001}00001\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{_async_telegram2_8h}{AsyncTelegram2.h}}"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00002}00002\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00003}\mbox{\hyperlink{_async_telegram2_8cpp_ad52684f7aaf665e4e3a804865854635a}{00003}}\ \textcolor{preprocessor}{\#define\ HEADERS\_END\ "{}\(\backslash\)r\(\backslash\)n\(\backslash\)r\(\backslash\)n"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00004}00004\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00005}\mbox{\hyperlink{class_async_telegram2_aa2da6b68a537f30474f2e0540f895372}{00005}}\ \mbox{\hyperlink{class_async_telegram2_aa2da6b68a537f30474f2e0540f895372}{AsyncTelegram2::AsyncTelegram2}}(Client\ \&client,\ uint32\_t\ bufferSize)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00006}00006\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00007}00007\ \ \ \ \ m\_botusername.reserve(32);\ \textcolor{comment}{//\ Telegram\ username\ is\ 5-\/32\ chars\ lenght}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00008}00008\ \ \ \ \ m\_rxbuffer.reserve(bufferSize);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00009}00009\ \ \ \ \ this-\/>telegramClient\ =\ \&client;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00010}00010\ \ \ \ \ m\_minUpdateTime\ =\ \mbox{\hyperlink{_async_telegram2_8h_a96ea578243c3f7e4a5f527b26d4b486b}{MIN\_UPDATE\_TIME}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00011}00011\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00012}00012\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00013}\mbox{\hyperlink{class_async_telegram2_a72bda6fec7f854f4668019ffa7529395}{00013}}\ \mbox{\hyperlink{class_async_telegram2_a72bda6fec7f854f4668019ffa7529395}{AsyncTelegram2::\string~AsyncTelegram2}}()\{\};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00014}00014\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00015}\mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{00015}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{AsyncTelegram2::checkConnection}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00016}00016\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00017}00017\ \ \ \ \ \textcolor{comment}{//\ Start\ connection\ with\ Telegramn\ server\ (if\ necessary)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00018}00018\ \ \ \ \ \textcolor{keywordflow}{if}\ (!telegramClient-\/>connected())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00019}00019\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00020}00020\ \ \ \ \ \ \ \ \ m\_lastmsg\_timestamp\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00021}00021\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a8b581e655c12106bd78a636d1d107651}{log\_info}}(\textcolor{stringliteral}{"{}Start\ handshaking..."{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00022}00022\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00023}00023\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ESP8266\ Soft\ watch\ dog\ reset\ issue}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00024}00024\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#ifdef\ ESP8266}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00025}00025\ \ \ \ \ \ \ \ \ ESP.wdtDisable();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00026}00026\ \ \ \ \ \ \ \ \ *((\textcolor{keyword}{volatile}\ uint32\_t*)\ 0x60000900)\ \&=\ \string~(1);\ \textcolor{comment}{//\ Hardware\ WDT\ OFF}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00027}00027\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00028}00028\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!telegramClient-\/>connect(\mbox{\hyperlink{_async_telegram2_8h_ae085db1a0ead459849445d9aaa10a2fe}{TELEGRAM\_HOST}},\ \mbox{\hyperlink{_async_telegram2_8h_a5d9b7639c33143f4e89890029153ffcf}{TELEGRAM\_PORT}}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00029}00029\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00030}00030\ \ \ \ \ \ \ \ \ \ \ \ \ Serial.println(\textcolor{stringliteral}{"{}\(\backslash\)n\(\backslash\)nUnable\ to\ connect\ to\ Telegram\ server"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00031}00031\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a7c66734e475862fe039748724afbd7f8}{reset}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00032}00032\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00033}00033\ \textcolor{preprocessor}{\#if\ DEBUG\_ENABLE}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00034}00034\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00035}00035\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00036}00036\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ uint32\_t\ lastCTime;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00037}00037\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}Connected\ using\ Telegram\ hostname\(\backslash\)n"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00038}00038\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}Last\ connection\ was\ \%d\ seconds\ ago\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00039}00039\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{int})(millis()\ -\/\ lastCTime)\ /\ 1000);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00040}00040\ \ \ \ \ \ \ \ \ \ \ \ \ lastCTime\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00041}00041\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00042}00042\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00043}00043\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00044}00044\ \textcolor{preprocessor}{\ \ \ \ \#ifdef\ ESP8266}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00045}00045\ \ \ \ \ ESP.wdtEnable(10000);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00046}00046\ \ \ \ \ *((\textcolor{keyword}{volatile}\ uint32\_t*)\ 0x60000900)\ |=\ 1;\ \textcolor{comment}{//\ Hardware\ WDT\ ON}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00047}00047\ \textcolor{preprocessor}{\ \ \ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00048}00048\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00049}00049\ \ \ \ \ \textcolor{keywordflow}{return}\ telegramClient-\/>connected();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00050}00050\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00051}00051\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00052}\mbox{\hyperlink{class_async_telegram2_a30f85b610901712f91ff48432d8ff5e8}{00052}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a30f85b610901712f91ff48432d8ff5e8}{AsyncTelegram2::begin}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00053}00053\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00054}00054\ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{checkConnection}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00055}00055\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{class_async_telegram2_ad4395d7cd810db616b083529ff434ae6}{getMe}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00056}00056\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00057}00057\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00058}\mbox{\hyperlink{class_async_telegram2_a7c66734e475862fe039748724afbd7f8}{00058}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a7c66734e475862fe039748724afbd7f8}{AsyncTelegram2::reset}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00059}00059\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00060}00060\ \ \ \ \ \textcolor{keyword}{static}\ uint32\_t\ lastResetTime;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00061}00061\ \ \ \ \ \textcolor{keywordflow}{if}\ (millis()\ -\/\ lastResetTime\ >\ 5000)\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00062}00062\ \ \ \ \ \ \ \ \ lastResetTime\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00063}00063\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a8b581e655c12106bd78a636d1d107651}{log\_info}}(\textcolor{stringliteral}{"{}Restart\ Telegram\ connection\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00064}00064\ \ \ \ \ \ \ \ \ telegramClient-\/>stop();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00065}00065\ \ \ \ \ \ \ \ \ m\_lastmsg\_timestamp\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00066}00066\ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00067}00067\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00068}00068\ \ \ \ \ \textcolor{keywordflow}{return}\ telegramClient-\/>connected();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00069}00069\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00070}00070\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00071}\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{00071}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{AsyncTelegram2::sendCommand}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *command,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *payload,\ \textcolor{keywordtype}{bool}\ blocking)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00072}00072\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00073}00073\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{checkConnection}}())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00074}00074\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00075}00075\ \ \ \ \ \ \ \ \ String\ httpBuffer((\textcolor{keywordtype}{char}\ *)0);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00076}00076\ \ \ \ \ \ \ \ \ httpBuffer.reserve(\mbox{\hyperlink{_data_structures_8h_a88c571692cc653ac156068c0071b0aa7}{BUFFER\_BIG}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00077}00077\ \ \ \ \ \ \ \ \ httpBuffer\ =\ \textcolor{stringliteral}{"{}POST\ https://"{}}\ \mbox{\hyperlink{_async_telegram2_8h_ae085db1a0ead459849445d9aaa10a2fe}{TELEGRAM\_HOST}}\ \textcolor{stringliteral}{"{}/bot"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00078}00078\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ m\_token;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00079}00079\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ \textcolor{stringliteral}{"{}/"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00080}00080\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ command;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00081}00081\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Let's\ use\ 1.0\ protocol\ in\ order\ to\ avoid\ chunked\ transfer\ encoding}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00082}00082\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ \textcolor{stringliteral}{"{}\ HTTP/1.0"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00083}00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)nHost:\ api.telegram.org"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00084}00084\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)nConnection:\ keep-\/alive"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00085}00085\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)nContent-\/Type:\ application/json"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00086}00086\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)nContent-\/Length:\ "{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00087}00087\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ strlen(payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00088}00088\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)n\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00089}00089\ \ \ \ \ \ \ \ \ httpBuffer\ +=\ payload;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00090}00090\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Send\ the\ whole\ request\ in\ one\ go\ is\ much\ faster}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00091}00091\ \ \ \ \ \ \ \ \ telegramClient-\/>print(httpBuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00092}00092\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00093}00093\ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00094}00094\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Blocking\ mode}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00095}00095\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (blocking)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00096}00096\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00097}00097\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!telegramClient-\/>find((\textcolor{keywordtype}{char}\ *)\mbox{\hyperlink{_async_telegram2_8cpp_ad52684f7aaf665e4e3a804865854635a}{HEADERS\_END}}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00098}00098\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00099}00099\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}Invalid\ HTTP\ response"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00100}00100\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ telegramClient-\/>stop();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00101}00101\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00102}00102\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00103}00103\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ there\ are\ incoming\ bytes\ available\ from\ the\ server,\ read\ them\ and\ print\ them:}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00104}00104\ \ \ \ \ \ \ \ \ \ \ \ \ m\_rxbuffer\ =\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00105}00105\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{while}\ (telegramClient-\/>available())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00106}00106\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00107}00107\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ yield();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00108}00108\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_rxbuffer\ +=\ (char)telegramClient-\/>read();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00109}00109\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00110}00110\ \ \ \ \ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00111}00111\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_rxbuffer.indexOf(\textcolor{stringliteral}{"{}\(\backslash\)"{}ok\(\backslash\)"{}:true"{}})\ >\ -\/1)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00112}00112\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00113}00113\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00114}00114\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00115}00115\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00116}00116\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00117}00117\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00118}00118\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00119}\mbox{\hyperlink{class_async_telegram2_a6a8e63acbda809e800b7be0ad08d3d87}{00119}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a6a8e63acbda809e800b7be0ad08d3d87}{AsyncTelegram2::getUpdates}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00120}00120\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00121}00121\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00122}00122\ \ \ \ \ \textcolor{comment}{//\ No\ response\ from\ Telegram\ server\ for\ a\ long\ time}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00123}00123\ \ \ \ \ \textcolor{keywordflow}{if}\ (millis()\ -\/\ m\_lastmsg\_timestamp\ >\ 10\ *\ m\_minUpdateTime)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00124}00124\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00125}00125\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a7c66734e475862fe039748724afbd7f8}{reset}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00126}00126\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00127}00127\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00128}00128\ \ \ \ \ \textcolor{comment}{//\ Send\ message\ to\ Telegram\ server\ only\ if\ enough\ time\ has\ passed\ since\ last}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00129}00129\ \ \ \ \ \textcolor{keywordflow}{if}\ (millis()\ -\/\ m\_lastUpdateTime\ >\ m\_minUpdateTime)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00130}00130\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00131}00131\ \ \ \ \ \ \ \ \ m\_lastUpdateTime\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00132}00132\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00133}00133\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ previuos\ reply\ from\ server\ was\ received\ (and\ parsed)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00134}00134\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_waitingReply\ ==\ \textcolor{keyword}{false})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00135}00135\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00136}00136\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00137}00137\ \ \ \ \ \ \ \ \ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},\ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}limit\(\backslash\)"{}:1,\(\backslash\)"{}timeout\(\backslash\)"{}:0,\(\backslash\)"{}offset\(\backslash\)"{}:\%"{}}\ \mbox{\hyperlink{_async_telegram2_8h_aac92c5ec332dafe0abb24688dad1b795}{INT32}}\ \textcolor{stringliteral}{"{}\}"{}},\ m\_lastUpdateId);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00138}00138\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}getUpdates"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00139}00139\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00140}00140\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00141}00141\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00142}00142\ \ \ \ \ \textcolor{keywordflow}{if}\ (telegramClient-\/>connected()\ \&\&\ telegramClient-\/>available())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00143}00143\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00144}00144\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ We\ have\ a\ message,\ parse\ data\ received}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00145}00145\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ close\_connection\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00146}00146\ \ \ \ \ \ \ \ \ uint16\_t\ len\ =\ 0,\ pos\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00147}00147\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Skip\ headers}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00148}00148\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{while}\ (telegramClient-\/>connected())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00149}00149\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00150}00150\ \ \ \ \ \ \ \ \ \ \ \ \ String\ line\ =\ telegramClient-\/>readStringUntil(\textcolor{charliteral}{'\(\backslash\)n'});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00151}00151\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (line\ ==\ \textcolor{stringliteral}{"{}\(\backslash\)r"{}})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00152}00152\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00153}00153\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (line.indexOf(\textcolor{stringliteral}{"{}close"{}})\ >\ -\/1)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00154}00154\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00155}00155\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ close\_connection\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00156}00156\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00157}00157\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (line.indexOf(\textcolor{stringliteral}{"{}Content-\/Length:"{}})\ >\ -\/1)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00158}00158\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00159}00159\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ len\ =\ line.substring(strlen(\textcolor{stringliteral}{"{}Content-\/Length:\ "{}})).toInt();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00160}00160\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00161}00161\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00162}00162\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00163}00163\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ there\ are\ incoming\ bytes\ available\ from\ the\ server,\ read\ them\ and\ store:}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00164}00164\ \ \ \ \ \ \ \ \ m\_rxbuffer\ =\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00165}00165\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint32\_t\ timeout\ =\ millis();\ (millis()\ -\/\ timeout\ >\ 1000)\ ||\ pos\ <\ len;)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00166}00166\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00167}00167\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (telegramClient-\/>available())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00168}00168\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00169}00169\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_rxbuffer\ +=\ (char)telegramClient-\/>read();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00170}00170\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pos++;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00171}00171\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00172}00172\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00173}00173\ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00174}00174\ \ \ \ \ \ \ \ \ m\_lastmsg\_timestamp\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00175}00175\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00176}00176\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (close\_connection)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00177}00177\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00178}00178\ \ \ \ \ \ \ \ \ \ \ \ \ telegramClient-\/>stop();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00179}00179\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a8b581e655c12106bd78a636d1d107651}{log\_info}}(\textcolor{stringliteral}{"{}Connection\ closed\ from\ server"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00180}00180\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00181}00181\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00182}00182\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_rxbuffer.indexOf(\textcolor{stringliteral}{"{}\(\backslash\)"{}ok\(\backslash\)"{}:true"{}})\ >\ -\/1)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00183}00183\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00184}00184\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_sentCallback\ !=\ \textcolor{keyword}{nullptr}\ \&\&\ m\_waitSent)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00185}00185\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00186}00186\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_rxbuffer.indexOf(String(m\_lastSentMsgId))\ >\ -\/1)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00187}00187\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00188}00188\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_sentCallback(m\_waitSent);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00189}00189\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_waitSent\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00190}00190\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00191}00191\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00192}00192\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00193}00193\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00194}00194\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00195}00195\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00196}00196\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(m\_rxbuffer.c\_str());}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00197}00197\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (m\_sentCallback\ !=\ \textcolor{keyword}{nullptr}\ \&\&\ m\_waitSent)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00198}00198\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00199}00199\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_waitSent\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00200}00200\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_sentCallback(m\_waitSent);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00201}00201\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00202}00202\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00203}00203\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00204}00204\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00205}00205\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00206}00206\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00207}00207\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00208}00208\ \textcolor{comment}{//\ Parse\ message\ received\ from\ Telegram\ server}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00209}\mbox{\hyperlink{class_async_telegram2_a79915206e619151282347de69c1c715d}{00209}}\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013}{MessageType}}\ \mbox{\hyperlink{class_async_telegram2_a79915206e619151282347de69c1c715d}{AsyncTelegram2::getNewMessage}}(\mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ \&message)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00210}00210\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00211}00211\ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a8172bf8ec594eb409432f26d55de6268}{MessageNoData}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00212}00212\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00213}00213\ \ \ \ \ \textcolor{comment}{//\ Last\ sent\ message\ timeout}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00214}00214\ \ \ \ \ \textcolor{keywordflow}{if}\ (millis()\ -\/\ m\_lastSentTime\ >\ m\_sentTimeout\ \&\&\ m\_waitSent\ \&\&\ m\_sentCallback\ !=\ \textcolor{keyword}{nullptr})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00215}00215\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00216}00216\ \ \ \ \ \ \ \ \ m\_waitSent\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00217}00217\ \ \ \ \ \ \ \ \ m\_sentCallback(m\_waitSent);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00218}00218\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00219}00219\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00220}00220\ \ \ \ \ \textcolor{comment}{//\ We\ have\ a\ message,\ parse\ data\ received}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00221}00221\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_async_telegram2_a6a8e63acbda809e800b7be0ad08d3d87}{getUpdates}}())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00222}00222\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00223}00223\ \ \ \ \ \ \ \ \ JsonVariant\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00224}00224\ \ \ \ \ \ \ \ \ \{\ \textcolor{comment}{//\ Add\ as\ scope\ in\ order\ to\ destroy\ updateDoc\ as\ soon\ as\ possible}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00225}00225\ \ \ \ \ \ \ \ \ \ \ \ \ DynamicJsonDocument\ updateDoc(m\_JsonBufferSize);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00226}00226\ \ \ \ \ \ \ \ \ \ \ \ \ DeserializationError\ err\ =\ deserializeJson(updateDoc,\ m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00227}00227\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (err)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00228}00228\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00229}00229\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}deserializeJson()\ failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00230}00230\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}\%s"{}},\ err.c\_str());}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00231}00231\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00232}00232\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00233}00233\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Skip\ this\ message\ id\ due\ to\ the\ impossibility\ to\ parse\ correctly}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00234}00234\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_lastUpdateId\ =\ m\_rxbuffer.substring(m\_rxbuffer.indexOf(F(\textcolor{stringliteral}{"{}\(\backslash\)"{}update\_id\(\backslash\)"{}:"{}}))\ +\ strlen(\textcolor{stringliteral}{"{}\(\backslash\)"{}update\_id\(\backslash\)"{}:"{}})).toInt()\ +\ 1;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00235}00235\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ int64\_t\ chat\_id\ =\ m\_rxbuffer.substring(\ m\_rxbuffer.indexOf("{}\{\(\backslash\)"{}id\(\backslash\)"{}:"{})\ +\ strlen("{}\{\(\backslash\)"{}id\(\backslash\)"{}:"{})).toInt();}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00236}00236\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_rxbuffer\ =\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00237}00237\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00238}00238\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Inform\ the\ user\ about\ parsing\ error\ (blocking)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00239}00239\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a46f9dc85d1e8226a06b53755e9455914}{sendTo}}(message.\mbox{\hyperlink{struct_t_b_message_a3ac03984cd7eb5b8c7e4bd4e01331c1f}{chatId}},\ \textcolor{stringliteral}{"{}[ERROR]\ -\/\ No\ memory:\ inrease\ buffer\ size\ with\ \(\backslash\)"{}setJsonBufferSize(buf\_size)\(\backslash\)"{}\ method"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00240}00240\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a8172bf8ec594eb409432f26d55de6268}{MessageNoData}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00241}00241\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00242}00242\ \ \ \ \ \ \ \ \ \ \ \ \ updateDoc.shrinkToFit();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00243}00243\ \ \ \ \ \ \ \ \ \ \ \ \ m\_rxbuffer\ =\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00244}00244\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00245}00245\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!updateDoc.containsKey(\textcolor{stringliteral}{"{}result"{}}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00246}00246\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00247}00247\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}JSON\ data\ not\ expected"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00248}00248\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ serializeJsonPretty(updateDoc,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00249}00249\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a8172bf8ec594eb409432f26d55de6268}{MessageNoData}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00250}00250\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00251}00251\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00252}00252\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ updateDoc[\textcolor{stringliteral}{"{}result"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00253}00253\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (result.is<JsonArray>())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00254}00254\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00255}00255\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ result[0];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00256}00256\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00257}00257\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00258}00258\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00259}00259\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ This\ a\ reply\ after\ send\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00260}00260\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message\_id"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00261}00261\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00262}00262\ \ \ \ \ \ \ \ \ \ \ \ \ m\_lastSentMsgId\ =\ result[\textcolor{stringliteral}{"{}message\_id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00263}00263\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00264}00264\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00265}00265\ \ \ \ \ \ \ \ \ uint32\_t\ updateID\ =\ result[\textcolor{stringliteral}{"{}update\_id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00266}00266\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (updateID)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00267}00267\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00268}00268\ \ \ \ \ \ \ \ \ \ \ \ \ m\_lastUpdateId\ =\ updateID\ +\ 1;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00269}00269\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00270}00270\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00271}00271\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00272}00272\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ In\ case\ of\ forwarded\ message\ reply,\ we\ need\ to\ get\ original\ text}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00273}00273\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ so\ don't\ skip\ parsing\ the\ reply\ to\ just\ sent\ forwarMessage\ command}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00274}00274\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!result[\textcolor{stringliteral}{"{}forward\_from"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00275}00275\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a8172bf8ec594eb409432f26d55de6268}{MessageNoData}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00276}00276\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00277}00277\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00278}00278\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(result,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00279}00279\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}id"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00280}00280\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00281}00281\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ callback\ query}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00282}00282\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a7a7bdc57e98059b74049936d3dadf1ae}{id}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00283}00283\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_ae6932180f75bdf455cf4afb89cb6d216}{username}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00284}00284\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a3288745f836368bdc2135303ebfd1e32}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00285}00285\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_af8dfa5b3e59c95d741cc19f1af3dda4d}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00286}00286\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00287}00287\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a3ac03984cd7eb5b8c7e4bd4e01331c1f}{chatId}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}chat"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00288}00288\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aee364e5f0224df393743e21268f66bbd}{messageID}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}message\_id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00289}00289\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a62f4c64ae68b56689d8ca8580e536c0e}{date}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}date"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00290}00290\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a92c0786d72ff5de5e3f1bd16884e9583}{chatInstance}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}chat\_instance"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00291}00291\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a577e24c27938bb8d26a98a82788690e1}{callbackQueryID}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00292}00292\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a8c6cd2c1bcde0342b0ac0b8092d982ae}{callbackQueryData}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}data"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00293}00293\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a2920713025cb9908f957146f6afba725}{text}}\ =\ result[\textcolor{stringliteral}{"{}callback\_query"{}}][\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}text"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00294}00294\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013ac14c734b9662254c9072ecc6b7494830}{MessageQuery}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00295}00295\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00296}00296\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ if\ callback\ function\ is\ defined\ for\ this\ button\ query}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00297}00297\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint8\_t\ i\ =\ 0;\ i\ <\ m\_keyboardCount;\ i++)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00298}00298\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m\_keyboards[i]-\/>checkCallback(message);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00299}00299\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00300}00300\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}forward\_from"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00301}00301\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00302}00302\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ forwarded\ message\ from\ user\ or\ group}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00303}00303\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a7a7bdc57e98059b74049936d3dadf1ae}{id}}\ =\ result[\textcolor{stringliteral}{"{}forward\_from"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00304}00304\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_ae6932180f75bdf455cf4afb89cb6d216}{username}}\ =\ result[\textcolor{stringliteral}{"{}forward\_from"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00305}00305\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a3288745f836368bdc2135303ebfd1e32}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}forward\_from"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00306}00306\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_af8dfa5b3e59c95d741cc19f1af3dda4d}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}forward\_from"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00307}00307\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00308}00308\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a2920713025cb9908f957146f6afba725}{text}}\ =\ result[\textcolor{stringliteral}{"{}text"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00309}00309\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a37468e385f9166fe5d7650d2434b1de4}{MessageForwarded}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00310}00310\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00311}00311\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}message\_id"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00312}00312\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00313}00313\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00314}00314\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00315}00315\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a7a7bdc57e98059b74049936d3dadf1ae}{id}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00316}00316\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_ae6932180f75bdf455cf4afb89cb6d216}{username}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00317}00317\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_a3288745f836368bdc2135303ebfd1e32}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00318}00318\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a91616732440321d5eaa86f6e557ceceb}{sender}}.\mbox{\hyperlink{struct_t_b_user_af8dfa5b3e59c95d741cc19f1af3dda4d}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}from"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00319}00319\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00320}00320\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aee364e5f0224df393743e21268f66bbd}{messageID}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}message\_id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00321}00321\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a3ac03984cd7eb5b8c7e4bd4e01331c1f}{chatId}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}chat"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00322}00322\ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a62f4c64ae68b56689d8ca8580e536c0e}{date}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}date"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00323}00323\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00324}00324\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}location"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00325}00325\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00326}00326\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ location\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00327}00327\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_adfab6e4ed0a32eb72a84af1647430bb5}{location}}.\mbox{\hyperlink{struct_t_b_location_a5fcb184937d38dca6b3be17627223d4e}{longitude}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}location"{}}][\textcolor{stringliteral}{"{}longitude"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00328}00328\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_adfab6e4ed0a32eb72a84af1647430bb5}{location}}.\mbox{\hyperlink{struct_t_b_location_a35ea558308a99e9df3e23ca81cdb032b}{latitude}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}location"{}}][\textcolor{stringliteral}{"{}latitude"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00329}00329\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013aaabcafa1fff25bdbf94e371cb54179d8}{MessageLocation}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00330}00330\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00331}00331\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00332}00332\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00333}00333\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ contact\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00334}00334\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a03e0503c26921fa895aa602ca2cb0816}{contact}}.\mbox{\hyperlink{struct_t_b_contact_ac7c11fe1902535cdf9006c9f57be8d82}{id}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}][\textcolor{stringliteral}{"{}user\_id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00335}00335\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a03e0503c26921fa895aa602ca2cb0816}{contact}}.\mbox{\hyperlink{struct_t_b_contact_a58515374fabb74b5762a464a8a5aae3a}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00336}00336\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a03e0503c26921fa895aa602ca2cb0816}{contact}}.\mbox{\hyperlink{struct_t_b_contact_ab3179716a52645d6dfaa322ebafee286}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00337}00337\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a03e0503c26921fa895aa602ca2cb0816}{contact}}.\mbox{\hyperlink{struct_t_b_contact_a1f1f3ad9ad256ef8dc9a900835ad3297}{phoneNumber}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}][\textcolor{stringliteral}{"{}phone\_number"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00338}00338\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a03e0503c26921fa895aa602ca2cb0816}{contact}}.\mbox{\hyperlink{struct_t_b_contact_a7a2eec7e8f285f716775ede283083846}{vCard}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}contact"{}}][\textcolor{stringliteral}{"{}vcard"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00339}00339\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013ac21bc2b1523bb02a1c59309e8b731fe1}{MessageContact}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00340}00340\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00341}00341\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00342}00342\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00343}00343\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ add\ member\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00344}00344\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_acf866f0825ebee6f15f320b98ff752a1}{isBot}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}is\_bot"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00345}00345\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_a7a7bdc57e98059b74049936d3dadf1ae}{id}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00346}00346\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_a3288745f836368bdc2135303ebfd1e32}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00347}00347\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_af8dfa5b3e59c95d741cc19f1af3dda4d}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00348}00348\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_ae6932180f75bdf455cf4afb89cb6d216}{username}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00349}00349\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a36b8eb4d4689ede17d158b608da5b541}{MessageNewMember}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00350}00350\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00351}00351\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}left\_chat\_member"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00352}00352\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00353}00353\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ left\ member\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00354}00354\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_acf866f0825ebee6f15f320b98ff752a1}{isBot}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}is\_bot"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00355}00355\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_a7a7bdc57e98059b74049936d3dadf1ae}{id}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}id"{}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00356}00356\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_a3288745f836368bdc2135303ebfd1e32}{firstName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}first\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00357}00357\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_af8dfa5b3e59c95d741cc19f1af3dda4d}{lastName}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}last\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00358}00358\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a254e3de624772a0a9df76b04687bd08b}{member}}.\mbox{\hyperlink{struct_t_b_user_ae6932180f75bdf455cf4afb89cb6d216}{username}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}new\_chat\_member"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00359}00359\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013af78485bf4d25aa3d7538554106eb8705}{MessageLeftMember}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00360}00360\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00361}00361\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}document"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00362}00362\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00363}00363\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ document\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00364}00364\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a48fe3d02e480acb3ec3b41e96e312579}{document}}.\mbox{\hyperlink{struct_t_b_document_abc577e94ccfda828dfdcf6a4959c2583}{file\_id}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}document"{}}][\textcolor{stringliteral}{"{}file\_id"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00365}00365\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a48fe3d02e480acb3ec3b41e96e312579}{document}}.\mbox{\hyperlink{struct_t_b_document_a6c41149949727bea7502586323748832}{file\_name}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}document"{}}][\textcolor{stringliteral}{"{}file\_name"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00366}00366\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a2920713025cb9908f957146f6afba725}{text}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}caption"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00367}00367\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a48fe3d02e480acb3ec3b41e96e312579}{document}}.\mbox{\hyperlink{struct_t_b_document_a44b4989592d79a3ade348b7fdf010e80}{file\_exists}}\ =\ \mbox{\hyperlink{class_async_telegram2_a427a550eb618a3f4383b51a3756e7a8b}{getFile}}(message.\mbox{\hyperlink{struct_t_b_message_a48fe3d02e480acb3ec3b41e96e312579}{document}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00368}00368\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a00c13e51748441c150708f872958f9bf}{MessageDocument}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00369}00369\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00370}00370\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}reply\_to\_message"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00371}00371\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00372}00372\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ reply\ to\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00373}00373\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a2920713025cb9908f957146f6afba725}{text}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}text"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00374}00374\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a97f2e195f3252f74e85a1fe25fe26558}{MessageReply}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00375}00375\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00376}00376\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}text"{}}])}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00377}00377\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00378}00378\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ is\ a\ text\ message}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00379}00379\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_a2920713025cb9908f957146f6afba725}{text}}\ =\ result[\textcolor{stringliteral}{"{}message"{}}][\textcolor{stringliteral}{"{}text"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00380}00380\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}}\ =\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a48e20971b311ab6bbf2a2de2ca281a53}{MessageText}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00381}00381\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00382}00382\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00383}00383\ \ \ \ \ \ \ \ \ m\_lastSentMsgId\ =\ message.\mbox{\hyperlink{struct_t_b_message_aee364e5f0224df393743e21268f66bbd}{messageID}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00384}00384\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ message.\mbox{\hyperlink{struct_t_b_message_aaf84d19c6bfc71c449f711740d42627d}{messageType}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00385}00385\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00386}00386\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{_data_structures_8h_ac6606ebe91c8ac66a2c314c79f5ab013a8172bf8ec594eb409432f26d55de6268}{MessageNoData}};\ \textcolor{comment}{//\ waiting\ for\ reply\ from\ server}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00387}00387\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00388}00388\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00389}00389\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00390}00390\ \textcolor{comment}{//\ Blocking\ getMe\ function\ (we\ wait\ for\ a\ reply\ from\ Telegram\ server)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00391}\mbox{\hyperlink{class_async_telegram2_ad4395d7cd810db616b083529ff434ae6}{00391}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_ad4395d7cd810db616b083529ff434ae6}{AsyncTelegram2::getMe}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00392}00392\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00393}00393\ \ \ \ \ \textcolor{comment}{//\ getMe\ has\ to\ be\ blocking\ (wait\ server\ reply)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00394}00394\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}getMe"{}},\ \textcolor{stringliteral}{"{}"{}},\ \textcolor{keyword}{true}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00395}00395\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00396}00396\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}getMe\ error\ "{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00397}00397\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00398}00398\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00399}00399\ \ \ \ \ StaticJsonDocument<BUFFER\_SMALL>\ smallDoc;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00400}00400\ \ \ \ \ deserializeJson(smallDoc,\ m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00401}00401\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(smallDoc,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00402}00402\ \ \ \ \ m\_botusername\ =\ smallDoc[\textcolor{stringliteral}{"{}result"{}}][\textcolor{stringliteral}{"{}username"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00403}00403\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00404}00404\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00405}00405\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00406}\mbox{\hyperlink{class_async_telegram2_a427a550eb618a3f4383b51a3756e7a8b}{00406}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a427a550eb618a3f4383b51a3756e7a8b}{AsyncTelegram2::getFile}}(\mbox{\hyperlink{struct_t_b_document}{TBDocument}}\ \&doc)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00407}00407\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00408}00408\ \ \ \ \ \textcolor{keywordtype}{char}\ cmd[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00409}00409\ \ \ \ \ snprintf(cmd,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},\ \textcolor{stringliteral}{"{}getFile?file\_id=\%s"{}},\ doc.\mbox{\hyperlink{struct_t_b_document_abc577e94ccfda828dfdcf6a4959c2583}{file\_id}}.c\_str());}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00410}00410\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00411}00411\ \ \ \ \ \textcolor{comment}{//\ getFile\ has\ to\ be\ blocking\ (wait\ server\ reply}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00412}00412\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(cmd,\ \textcolor{stringliteral}{"{}"{}},\ \textcolor{keyword}{true}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00413}00413\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00414}00414\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}getFile\ error"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00415}00415\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00416}00416\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00417}00417\ \ \ \ \ StaticJsonDocument<BUFFER\_MEDIUM>\ fileDoc;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00418}00418\ \ \ \ \ deserializeJson(fileDoc,\ m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00419}00419\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(fileDoc,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00420}00420\ \ \ \ \ doc.\mbox{\hyperlink{struct_t_b_document_a5a413708841ec79ea380483b24fcd56a}{file\_path}}\ =\ \textcolor{stringliteral}{"{}https://api.telegram.org/file/bot"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00421}00421\ \ \ \ \ doc.\mbox{\hyperlink{struct_t_b_document_a5a413708841ec79ea380483b24fcd56a}{file\_path}}\ +=\ m\_token;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00422}00422\ \ \ \ \ doc.\mbox{\hyperlink{struct_t_b_document_a5a413708841ec79ea380483b24fcd56a}{file\_path}}\ +=\ \textcolor{stringliteral}{"{}/"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00423}00423\ \ \ \ \ doc.\mbox{\hyperlink{struct_t_b_document_a5a413708841ec79ea380483b24fcd56a}{file\_path}}\ +=\ fileDoc[\textcolor{stringliteral}{"{}result"{}}][\textcolor{stringliteral}{"{}file\_path"{}}].as<String>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00424}00424\ \ \ \ \ doc.\mbox{\hyperlink{struct_t_b_document_a391a820b470617726194a73f8da17a82}{file\_size}}\ =\ fileDoc[\textcolor{stringliteral}{"{}result"{}}][\textcolor{stringliteral}{"{}file\_size"{}}].as<\textcolor{keywordtype}{long}>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00425}00425\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00426}00426\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00427}00427\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00428}\mbox{\hyperlink{class_async_telegram2_aaec5ad8e68a7409c21ae629545407fad}{00428}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_aaec5ad8e68a7409c21ae629545407fad}{AsyncTelegram2::noNewMessage}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00429}00429\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00430}00430\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00431}00431\ \ \ \ \ \mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ msg;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00432}00432\ \ \ \ \ this-\/>\mbox{\hyperlink{class_async_telegram2_a7c66734e475862fe039748724afbd7f8}{reset}}();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00433}00433\ \ \ \ \ this-\/>\mbox{\hyperlink{class_async_telegram2_a79915206e619151282347de69c1c715d}{getNewMessage}}(msg);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00434}00434\ \ \ \ \ \textcolor{keywordflow}{while}\ (!this-\/>\mbox{\hyperlink{class_async_telegram2_a6a8e63acbda809e800b7be0ad08d3d87}{getUpdates}}())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00435}00435\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00436}00436\ \ \ \ \ \ \ \ \ delay(100);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00437}00437\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ if(millis()\ -\/\ startTime\ >\ 10000UL)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00438}00438\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ \ \ \ \ break;}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00439}00439\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00440}00440\ \ \ \ \ \textcolor{comment}{//\ log\_debug("{}\(\backslash\)n"{});}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00441}00441\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00442}00442\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00443}00443\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00444}\mbox{\hyperlink{class_async_telegram2_a7a1204213ca3392f446e7286112cc1e8}{00444}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a7a1204213ca3392f446e7286112cc1e8}{AsyncTelegram2::sendMessage}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ \&msg,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *message,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *keyboard,\ \textcolor{keywordtype}{bool}\ wait)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00445}00445\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00446}00446\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00447}00447\ \ \ \ \ \textcolor{keywordflow}{if}\ (!strlen(message))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00448}00448\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00449}00449\ \ \ \ \ m\_waitSent\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00450}00450\ \ \ \ \ m\_lastSentTime\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00451}00451\ \ \ \ \ m\_lastSentMsgId\ +=\ 1;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00452}00452\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00453}00453\ \ \ \ \ DynamicJsonDocument\ root(\mbox{\hyperlink{_data_structures_8h_a88c571692cc653ac156068c0071b0aa7}{BUFFER\_BIG}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00454}00454\ \ \ \ \ \textcolor{comment}{//\ Backward\ compatibility}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00455}00455\ \ \ \ \ \textcolor{comment}{//\ root["{}chat\_id"{}]\ =\ msg.sender.id\ !=\ 0\ ?\ msg.sender.id\ :\ msg.chatId;}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00456}00456\ \ \ \ \ root[\textcolor{stringliteral}{"{}chat\_id"{}}]\ =\ msg.\mbox{\hyperlink{struct_t_b_message_a3ac03984cd7eb5b8c7e4bd4e01331c1f}{chatId}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00457}00457\ \ \ \ \ root[\textcolor{stringliteral}{"{}text"{}}]\ =\ message;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00458}00458\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00459}00459\ \ \ \ \ \textcolor{keywordflow}{switch}\ (m\_formatType)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00460}00460\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00461}00461\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10a30e126b7c8e791e3c14a0de4aa6db7b8}{FormatStyle::NONE}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00462}00462\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00463}00463\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10abcff4774f8b4c305dcb53e7e5782415c}{FormatStyle::HTML}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00464}00464\ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}parse\_mode"{}}]\ =\ \textcolor{stringliteral}{"{}HTML"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00465}00465\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00466}00466\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10abe53632e1a588b53f88ca5785ad107f0}{FormatStyle::MARKDOWN}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00467}00467\ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}parse\_mode"{}}]\ =\ \textcolor{stringliteral}{"{}MarkdownV2"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00468}00468\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00469}00469\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00470}00470\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00471}00471\ \ \ \ \ \textcolor{keywordflow}{if}\ (msg.\mbox{\hyperlink{struct_t_b_message_a2b3fa338410399dd2dac8e6bc0b8e8db}{disable\_notification}})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00472}00472\ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}disable\_notification"{}}]\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00473}00473\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00474}00474\ \ \ \ \ \textcolor{keywordflow}{if}\ (keyboard\ !=\ \textcolor{keyword}{nullptr})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00475}00475\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00476}00476\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (strlen(keyboard)\ ||\ msg.\mbox{\hyperlink{struct_t_b_message_ae78c22482705295fcab671e7f679f827}{force\_reply}})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00477}00477\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00478}00478\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ DynamicJsonDocument\ doc(BUFFER\_BIG);}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00479}00479\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00480}00480\ \textcolor{preprocessor}{\#if\ defined(ESP8266)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00481}00481\ \ \ \ \ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc(ESP.getMaxFreeBlockSize()\ -\/\ \mbox{\hyperlink{_data_structures_8h_a6c3da8213680f84f1ab89bdccde48fcd}{BUFFER\_MEDIUM}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00482}00482\ \textcolor{preprocessor}{\#elif\ defined(ESP32)}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00483}00483\ \ \ \ \ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc(ESP.getMaxAllocHeap());}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00484}00484\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00485}00485\ \ \ \ \ \ \ \ \ \ \ \ \ DynamicJsonDocument\ doc(\mbox{\hyperlink{_data_structures_8h_a88c571692cc653ac156068c0071b0aa7}{BUFFER\_BIG}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00486}00486\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00487}00487\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00488}00488\ \ \ \ \ \ \ \ \ \ \ \ \ deserializeJson(doc,\ keyboard);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00489}00489\ \ \ \ \ \ \ \ \ \ \ \ \ JsonObject\ myKeyb\ =\ doc.as<JsonObject>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00490}00490\ \ \ \ \ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}reply\_markup"{}}]\ =\ myKeyb;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00491}00491\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (msg.\mbox{\hyperlink{struct_t_b_message_ae78c22482705295fcab671e7f679f827}{force\_reply}})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00492}00492\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00493}00493\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}reply\_markup"{}}][\textcolor{stringliteral}{"{}selective"{}}]\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00494}00494\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}reply\_markup"{}}][\textcolor{stringliteral}{"{}force\_reply"{}}]\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00495}00495\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00496}00496\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00497}00497\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00498}00498\ \ \ \ \ root.shrinkToFit();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00499}00499\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00500}00500\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ len\ =\ measureJson(root);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00501}00501\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[len];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00502}00502\ \ \ \ \ serializeJson(root,\ payload,\ len);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00503}00503\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00504}00504\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(root,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00505}00505\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}sendMessage"{}},\ payload,\ wait);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00506}00506\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00507}00507\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00508}00508\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00509}\mbox{\hyperlink{class_async_telegram2_ae25e548e6abd3972b442b6d4d14a9a49}{00509}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_ae25e548e6abd3972b442b6d4d14a9a49}{AsyncTelegram2::forwardMessage}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ \&msg,\ \textcolor{keyword}{const}\ int64\_t\ to\_chatid)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00510}00510\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00511}00511\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00512}00512\ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00513}00513\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}chat\_id\(\backslash\)"{}:\%lld,\(\backslash\)"{}from\_chat\_id\(\backslash\)"{}:\%lld,\(\backslash\)"{}message\_id\(\backslash\)"{}:\%"{}}\ \mbox{\hyperlink{_async_telegram2_8h_aac92c5ec332dafe0abb24688dad1b795}{INT32}}\ \textcolor{stringliteral}{"{}\}"{}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00514}00514\ \ \ \ \ \ \ \ \ \ \ \ \ \ to\_chatid,\ msg.\mbox{\hyperlink{struct_t_b_message_a3ac03984cd7eb5b8c7e4bd4e01331c1f}{chatId}},\ msg.\mbox{\hyperlink{struct_t_b_message_aee364e5f0224df393743e21268f66bbd}{messageID}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00515}00515\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00516}00516\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}forwardMessage"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00517}00517\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00518}00518\ \ \ \ \ m\_lastUpdateTime\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00519}00519\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00520}00520\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00521}00521\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00522}\mbox{\hyperlink{class_async_telegram2_a590e45ec6415651989bfdb62547fec1b}{00522}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a590e45ec6415651989bfdb62547fec1b}{AsyncTelegram2::sendPhotoByUrl}}(\textcolor{keyword}{const}\ int64\_t\ \&chat\_id,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *url,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00523}00523\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00524}00524\ \ \ \ \ \textcolor{keywordflow}{if}\ (!strlen(url))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00525}00525\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00526}00526\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00527}00527\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00528}00528\ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00529}00529\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}chat\_id\(\backslash\)"{}:\%lld,\(\backslash\)"{}photo\(\backslash\)"{}:\(\backslash\)"{}\%s\(\backslash\)"{},\(\backslash\)"{}caption\(\backslash\)"{}:\(\backslash\)"{}\%s\(\backslash\)"{}\}"{}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00530}00530\ \ \ \ \ \ \ \ \ \ \ \ \ \ chat\_id,\ url,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00531}00531\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00532}00532\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}sendPhoto"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00533}00533\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}\%s"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00534}00534\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00535}00535\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00536}00536\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00537}\mbox{\hyperlink{class_async_telegram2_a0e6caf66c0341e5a68fa7f7edfe213f2}{00537}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a0e6caf66c0341e5a68fa7f7edfe213f2}{AsyncTelegram2::sendAnimationByUrl}}(\textcolor{keyword}{const}\ int64\_t\ \&chat\_id,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *url,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00538}00538\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00539}00539\ \ \ \ \ \textcolor{keywordflow}{if}\ (!strlen(url))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00540}00540\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00541}00541\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00542}00542\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00543}00543\ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00544}00544\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}chat\_id\(\backslash\)"{}:\%lld,\(\backslash\)"{}video\(\backslash\)"{}:\(\backslash\)"{}\%s\(\backslash\)"{},\(\backslash\)"{}caption\(\backslash\)"{}:\(\backslash\)"{}\%s\(\backslash\)"{}\}"{}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00545}00545\ \ \ \ \ \ \ \ \ \ \ \ \ \ chat\_id,\ url,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00546}00546\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00547}00547\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}sendVideo"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00548}00548\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}\%s"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00549}00549\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00550}00550\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00551}00551\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00552}\mbox{\hyperlink{class_async_telegram2_aa081b4af5340bd5a0dcc492d66540768}{00552}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_aa081b4af5340bd5a0dcc492d66540768}{AsyncTelegram2::sendToChannel}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *channel,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *message,\ \textcolor{keywordtype}{bool}\ silent)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00553}00553\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00554}00554\ \ \ \ \ \textcolor{keywordflow}{if}\ (!strlen(message))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00555}00555\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00556}00556\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00557}00557\ \ \ \ \ DynamicJsonDocument\ root(\mbox{\hyperlink{_data_structures_8h_a88c571692cc653ac156068c0071b0aa7}{BUFFER\_BIG}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00558}00558\ \ \ \ \ root[\textcolor{stringliteral}{"{}chat\_id"{}}]\ =\ channel;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00559}00559\ \ \ \ \ root[\textcolor{stringliteral}{"{}text"{}}]\ =\ message;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00560}00560\ \ \ \ \ root[\textcolor{stringliteral}{"{}silent"{}}]\ =\ silent\ ?\ \textcolor{stringliteral}{"{}true"{}}\ :\ \textcolor{stringliteral}{"{}false"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00561}00561\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00562}00562\ \ \ \ \ \textcolor{keywordflow}{switch}\ (m\_formatType)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00563}00563\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00564}00564\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10a30e126b7c8e791e3c14a0de4aa6db7b8}{FormatStyle::NONE}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00565}00565\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00566}00566\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10abcff4774f8b4c305dcb53e7e5782415c}{FormatStyle::HTML}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00567}00567\ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}parse\_mode"{}}]\ =\ \textcolor{stringliteral}{"{}HTML"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00568}00568\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00569}00569\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a18e57e92ff8d8d1c919b1852423b5d10abe53632e1a588b53f88ca5785ad107f0}{FormatStyle::MARKDOWN}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00570}00570\ \ \ \ \ \ \ \ \ root[\textcolor{stringliteral}{"{}parse\_mode"{}}]\ =\ \textcolor{stringliteral}{"{}MarkdownV2"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00571}00571\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00572}00572\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00573}00573\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00574}00574\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ len\ =\ measureJson(root);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00575}00575\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[len];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00576}00576\ \ \ \ \ serializeJson(root,\ payload,\ len);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00577}00577\ \ \ \ \ payload[len]\ =\ \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00578}00578\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}\%s"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00579}00579\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00580}00580\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}sendMessage"{}},\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00581}00581\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00582}00582\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00583}00583\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00584}00584\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00585}\mbox{\hyperlink{class_async_telegram2_a4e7d5186ea63a6e342503394189cf1c8}{00585}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a4e7d5186ea63a6e342503394189cf1c8}{AsyncTelegram2::endQuery}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ \&msg,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *message,\ \textcolor{keywordtype}{bool}\ alertMode)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00586}00586\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00587}00587\ \ \ \ \ \textcolor{keywordflow}{if}\ (!msg.\mbox{\hyperlink{struct_t_b_message_a577e24c27938bb8d26a98a82788690e1}{callbackQueryID}})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00588}00588\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00589}00589\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00590}00590\ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00591}00591\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}callback\_query\_id\(\backslash\)"{}:\%lld,\(\backslash\)"{}text\(\backslash\)"{}:\(\backslash\)"{}\%s\(\backslash\)"{},\(\backslash\)"{}cache\_time\(\backslash\)"{}:2,\(\backslash\)"{}show\_alert\(\backslash\)"{}:\%s\}"{}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00592}00592\ \ \ \ \ \ \ \ \ \ \ \ \ \ msg.\mbox{\hyperlink{struct_t_b_message_a577e24c27938bb8d26a98a82788690e1}{callbackQueryID}},\ message,\ alertMode\ ?\ \textcolor{stringliteral}{"{}true"{}}\ :\ \textcolor{stringliteral}{"{}false"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00593}00593\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}answerCallbackQuery"{}},\ payload,\ \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00594}00594\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00595}00595\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00596}00596\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00597}\mbox{\hyperlink{class_async_telegram2_aca60e039d76f080c3123cb329b18e831}{00597}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_aca60e039d76f080c3123cb329b18e831}{AsyncTelegram2::removeReplyKeyboard}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{struct_t_b_message}{TBMessage}}\ \&msg,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *message,\ \textcolor{keywordtype}{bool}\ selective)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00598}00598\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00599}00599\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[\mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00600}00600\ \ \ \ \ snprintf(payload,\ \mbox{\hyperlink{_data_structures_8h_ae25c3ea74ae70bd224ebb3d11a8cb5a4}{BUFFER\_SMALL}},}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00601}00601\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}remove\_keyboard\(\backslash\)"{}:true,\(\backslash\)"{}selective\(\backslash\)"{}:\%s\}"{}},\ selective\ ?\ \textcolor{stringliteral}{"{}true"{}}\ :\ \textcolor{stringliteral}{"{}false"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00602}00602\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a7a1204213ca3392f446e7286112cc1e8}{sendMessage}}(msg,\ message,\ payload);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00603}00603\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00604}00604\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00605}00605\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00606}00606\ \textcolor{comment}{//\ enum\ DocumentType\ \{\ DOCUMENT,\ PHOTO,\ ANIMATION,\ AUDIO,\ VOICE,\ VIDEO\};}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00607}\mbox{\hyperlink{class_async_telegram2_a78eed6d82d6cca9e3869dedf061590d0}{00607}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a78eed6d82d6cca9e3869dedf061590d0}{AsyncTelegram2::sendDocument}}(int64\_t\ chat\_id,\ Stream\ \&stream,\ \textcolor{keywordtype}{size\_t}\ size,}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00608}00608\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3ce}{DocumentType}}\ doc,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00609}00609\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00610}00610\ \ \ \ \ \textcolor{keywordflow}{switch}\ (doc)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00611}00611\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00612}00612\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cea9dac12e3c50154c1bdf2878c8c116ca9}{JSON}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00613}00613\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}application/json"{}},\ \textcolor{stringliteral}{"{}document"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00614}00614\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cea2388288943109c405b9ee7f18936d5d9}{CSV}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00615}00615\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}text/csv"{}},\ \textcolor{stringliteral}{"{}document"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00616}00616\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cea4f97963b62fbe2bcf52de140b710c820}{ZIP}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00617}00617\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}application/zip"{}},\ \textcolor{stringliteral}{"{}document"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00618}00618\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cead3436454c890ced213ecbb35a7efd17b}{PDF}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00619}00619\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}application/pdf"{}},\ \textcolor{stringliteral}{"{}document"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00620}00620\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cea5d559fa70b6ab890b18ad16f71b18462}{PHOTO}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00621}00621\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendPhoto"{}},\ \textcolor{stringliteral}{"{}image/jpeg"{}},\ \textcolor{stringliteral}{"{}photo"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00622}00622\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{class_async_telegram2_a4b9de602dc77a24e010788bb6d8ae3cea67c24f091f3223c581ebd5ec87fa8f63}{AUDIO}}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00623}00623\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}audio/mp3"{}},\ \textcolor{stringliteral}{"{}audio"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00624}00624\ \ \ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00625}00625\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sendStream(chat\_id,\ \textcolor{stringliteral}{"{}sendDocument"{}},\ \textcolor{stringliteral}{"{}text/plain"{}},\ \textcolor{stringliteral}{"{}document"{}},\ stream,\ size,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00626}00626\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00627}00627\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00628}00628\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00629}00629\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00630}00630\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00631}00631\ \textcolor{keywordtype}{void}\ AsyncTelegram2::setformData(int64\_t\ chat\_id,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *cmd,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *type,}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00632}00632\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *propName,\ \textcolor{keywordtype}{size\_t}\ size,\ String\ \&formData,}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00633}00633\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ \&request,\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00634}00634\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00635}00635\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00636}00636\ \textcolor{preprocessor}{\#define\ BOUNDARY\ "{}-\/-\/-\/-\/WebKitFormBoundary7MA4YWxkTrZu0gW"{}}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00637}00637\ \textcolor{preprocessor}{\#define\ END\_BOUNDARY\ "{}\(\backslash\)r\(\backslash\)n-\/-\/"{}}\ BOUNDARY\ "{}-\/-\/\(\backslash\)r\(\backslash\)n"{}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00638}00638\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00639}00639\ \ \ \ \ \textcolor{keywordtype}{char}\ int64\_buf[22]\ =\ \{0\};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00640}00640\ \ \ \ \ snprintf(int64\_buf,\ \textcolor{keyword}{sizeof}(int64\_buf),\ \textcolor{stringliteral}{"{}\%lld"{}},\ chat\_id);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00641}00641\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00642}00642\ \ \ \ \ formData\ =\ \textcolor{stringliteral}{"{}-\/-\/"{}}\ \mbox{\hyperlink{_async_telegram2_8cpp_a985bae7b67bcb96c5565a24a5f6d4cba}{BOUNDARY}}\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)nContent-\/disposition:\ form-\/data;\ name=\(\backslash\)"{}chat\_id\(\backslash\)"{}\(\backslash\)r\(\backslash\)n\(\backslash\)r\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00643}00643\ \ \ \ \ formData\ +=\ int64\_buf;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00644}00644\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00645}00645\ \ \ \ \ \textcolor{keywordflow}{if}\ (caption\ !=\ \textcolor{keyword}{nullptr})}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00646}00646\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00647}00647\ \ \ \ \ \ \ \ \ formData\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)n-\/-\/"{}}\ \mbox{\hyperlink{_async_telegram2_8cpp_a985bae7b67bcb96c5565a24a5f6d4cba}{BOUNDARY}}\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)nContent-\/disposition:\ form-\/data;\ name=\(\backslash\)"{}caption\(\backslash\)"{}\(\backslash\)r\(\backslash\)n\(\backslash\)r\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00648}00648\ \ \ \ \ \ \ \ \ formData\ +=\ caption;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00649}00649\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00650}00650\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00651}00651\ \ \ \ \ formData\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)n-\/-\/"{}}\ \mbox{\hyperlink{_async_telegram2_8cpp_a985bae7b67bcb96c5565a24a5f6d4cba}{BOUNDARY}}\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)nContent-\/disposition:\ form-\/data;\ name=\(\backslash\)"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00652}00652\ \ \ \ \ formData\ +=\ propName;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00653}00653\ \ \ \ \ formData\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)"{};\ filename=\(\backslash\)"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00654}00654\ \ \ \ \ formData\ +=\ filename\ !=\ \textcolor{keyword}{nullptr}\ ?\ filename\ :\ \textcolor{stringliteral}{"{}image.jpg"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00655}00655\ \ \ \ \ formData\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)"{}\(\backslash\)r\(\backslash\)nContent-\/Type:\ "{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00656}00656\ \ \ \ \ formData\ +=\ type;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00657}00657\ \ \ \ \ formData\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)"{}\(\backslash\)r\(\backslash\)n\(\backslash\)r\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00658}00658\ \ \ \ \ \textcolor{keywordtype}{int}\ contentLength\ =\ size\ +\ formData.length()\ +\ strlen(\mbox{\hyperlink{_async_telegram2_8cpp_a24a813330ce8132f9870ebfff57cb601}{END\_BOUNDARY}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00659}00659\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00660}00660\ \ \ \ \ request\ =\ \textcolor{stringliteral}{"{}POST\ /bot"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00661}00661\ \ \ \ \ request\ +=\ m\_token;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00662}00662\ \ \ \ \ request\ +=\ \textcolor{stringliteral}{"{}/"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00663}00663\ \ \ \ \ request\ +=\ cmd;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00664}00664\ \ \ \ \ request\ +=\ \textcolor{stringliteral}{"{}\ HTTP/1.0\(\backslash\)r\(\backslash\)nHost:\ "{}}\ \mbox{\hyperlink{_async_telegram2_8h_ae085db1a0ead459849445d9aaa10a2fe}{TELEGRAM\_HOST}}\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)nContent-\/Length:\ "{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00665}00665\ \ \ \ \ request\ +=\ contentLength;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00666}00666\ \ \ \ \ request\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)nContent-\/Type:\ multipart/form-\/data;\ boundary="{}}\ \mbox{\hyperlink{_async_telegram2_8cpp_a985bae7b67bcb96c5565a24a5f6d4cba}{BOUNDARY}}\ \textcolor{stringliteral}{"{}\(\backslash\)r\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00667}00667\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00668}00668\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00669}00669\ \textcolor{keywordtype}{bool}\ AsyncTelegram2::sendStream(int64\_t\ chat\_id,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *cmd,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *type,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *propName,}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00670}00670\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Stream\ \&stream,\ \textcolor{keywordtype}{size\_t}\ size,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename,\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00671}00671\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00672}00672\ \ \ \ \ \textcolor{keywordtype}{bool}\ res\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00673}00673\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{checkConnection}}())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00674}00674\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00675}00675\ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00676}00676\ \ \ \ \ \ \ \ \ String\ formData;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00677}00677\ \ \ \ \ \ \ \ \ formData.reserve(512);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00678}00678\ \ \ \ \ \ \ \ \ String\ request;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00679}00679\ \ \ \ \ \ \ \ \ request.reserve(256);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00680}00680\ \ \ \ \ \ \ \ \ setformData(chat\_id,\ cmd,\ type,\ propName,\ size,\ formData,\ request,\ filename,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00681}00681\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00682}00682\ \textcolor{preprocessor}{\#if\ DEBUG\_ENABLE}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00683}00683\ \ \ \ \ \ \ \ \ uint32\_t\ t1\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00684}00684\ \ \ \ \ \ \ \ \ Serial.println(request);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00685}00685\ \ \ \ \ \ \ \ \ Serial.println(formData);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00686}00686\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00687}00687\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Send\ POST\ request\ to\ host}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00688}00688\ \ \ \ \ \ \ \ \ telegramClient-\/>println(request);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00689}00689\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Body\ of\ request}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00690}00690\ \ \ \ \ \ \ \ \ telegramClient-\/>print(formData);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00691}00691\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00692}00692\ \ \ \ \ \ \ \ \ uint8\_t\ data[\mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00693}00693\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ n\_block\ =\ trunc(size\ /\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00694}00694\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ lastBytes\ =\ size\ -\/\ (n\_block\ *\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00695}00695\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00696}00696\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint16\_t\ pos\ =\ 0;\ pos\ <\ n\_block;\ pos++)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00697}00697\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00698}00698\ \ \ \ \ \ \ \ \ \ \ \ \ stream.readBytes(data,\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00699}00699\ \ \ \ \ \ \ \ \ \ \ \ \ telegramClient-\/>write(data,\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00700}00700\ \ \ \ \ \ \ \ \ \ \ \ \ yield();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00701}00701\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00702}00702\ \ \ \ \ \ \ \ \ stream.readBytes(data,\ lastBytes);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00703}00703\ \ \ \ \ \ \ \ \ telegramClient-\/>write(data,\ lastBytes);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00704}00704\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00705}00705\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Close\ the\ request\ form-\/data}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00706}00706\ \ \ \ \ \ \ \ \ telegramClient-\/>println(\mbox{\hyperlink{_async_telegram2_8cpp_a24a813330ce8132f9870ebfff57cb601}{END\_BOUNDARY}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00707}00707\ \ \ \ \ \ \ \ \ telegramClient-\/>flush();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00708}00708\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00709}00709\ \textcolor{preprocessor}{\#if\ DEBUG\_ENABLE}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00710}00710\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}Raw\ upload\ time:\ \%lums\(\backslash\)n"{}},\ millis()\ -\/\ t1);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00711}00711\ \ \ \ \ \ \ \ \ t1\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00712}00712\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00713}00713\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00714}00714\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Handle\ reply\ with\ getUpdates()\ method}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00715}00715\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00716}00716\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00717}00717\ \ \ \ \ \ \ \ \ Serial.println(\textcolor{stringliteral}{"{}\(\backslash\)nError:\ client\ not\ connected"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00718}00718\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00719}00719\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00720}00720\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00721}00721\ \textcolor{keywordtype}{bool}\ AsyncTelegram2::sendBuffer(int64\_t\ chat\_id,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *cmd,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *type,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *propName,\ uint8\_t\ *data,\ \textcolor{keywordtype}{size\_t}\ size,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caption)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00722}00722\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00723}00723\ \ \ \ \ \textcolor{keywordtype}{bool}\ res\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00724}00724\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_async_telegram2_a4cc01b5f954e7a6decb3e330fedab3ec}{checkConnection}}())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00725}00725\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00726}00726\ \ \ \ \ \ \ \ \ m\_waitingReply\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00727}00727\ \ \ \ \ \ \ \ \ String\ formData;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00728}00728\ \ \ \ \ \ \ \ \ formData.reserve(512);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00729}00729\ \ \ \ \ \ \ \ \ String\ request;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00730}00730\ \ \ \ \ \ \ \ \ request.reserve(256);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00731}00731\ \ \ \ \ \ \ \ \ setformData(chat\_id,\ cmd,\ type,\ propName,\ size,\ formData,\ request,\ caption,\ caption);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00732}00732\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00733}00733\ \textcolor{preprocessor}{\#if\ DEBUG\_ENABLE}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00734}00734\ \ \ \ \ \ \ \ \ uint32\_t\ t1\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00735}00735\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00736}00736\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Send\ POST\ request\ to\ host}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00737}00737\ \ \ \ \ \ \ \ \ telegramClient-\/>println(request);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00738}00738\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Body\ of\ request}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00739}00739\ \ \ \ \ \ \ \ \ telegramClient-\/>print(formData);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00740}00740\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00741}00741\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Serial.println(telegramClient-\/>write((const\ uint8\_t\ *)\ data,\ size));}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00742}00742\ \ \ \ \ \ \ \ \ uint16\_t\ pos\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00743}00743\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ n\_block\ =\ trunc(size\ /\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00744}00744\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ lastBytes\ =\ size\ -\/\ (n\_block\ *\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00745}00745\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00746}00746\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (pos\ =\ 0;\ pos\ <\ n\_block;\ pos++)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00747}00747\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00748}00748\ \ \ \ \ \ \ \ \ \ \ \ \ telegramClient-\/>write((\textcolor{keyword}{const}\ uint8\_t\ *)data\ +\ pos\ *\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}},\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00749}00749\ \ \ \ \ \ \ \ \ \ \ \ \ yield();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00750}00750\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00751}00751\ \ \ \ \ \ \ \ \ telegramClient-\/>write((\textcolor{keyword}{const}\ uint8\_t\ *)data\ +\ pos\ *\ \mbox{\hyperlink{_async_telegram2_8h_ad51ded0bbd705f02f73fc60c0b721ced}{BLOCK\_SIZE}},\ lastBytes);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00752}00752\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00753}00753\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Close\ the\ request\ form-\/data}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00754}00754\ \ \ \ \ \ \ \ \ telegramClient-\/>println(\mbox{\hyperlink{_async_telegram2_8cpp_a24a813330ce8132f9870ebfff57cb601}{END\_BOUNDARY}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00755}00755\ \ \ \ \ \ \ \ \ telegramClient-\/>flush();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00756}00756\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00757}00757\ \textcolor{preprocessor}{\#if\ DEBUG\_ENABLE}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00758}00758\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a0e81b2ed10f6207339675f22092a2c32}{log\_debug}}(\textcolor{stringliteral}{"{}Raw\ upload\ time:\ \%lums\(\backslash\)n"{}},\ millis()\ -\/\ t1);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00759}00759\ \ \ \ \ \ \ \ \ t1\ =\ millis();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00760}00760\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00761}00761\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00762}00762\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00763}00763\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00764}00764\ \ \ \ \ \ \ \ \ Serial.println(\textcolor{stringliteral}{"{}\(\backslash\)nError:\ client\ not\ connected"{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00765}00765\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00766}00766\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00767}00767\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00768}\mbox{\hyperlink{class_async_telegram2_a14dc64422808c51a7a14dd3261be575d}{00768}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_async_telegram2_a14dc64422808c51a7a14dd3261be575d}{AsyncTelegram2::getMyCommands}}(String\ \&cmdList)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00769}00769\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00770}00770\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}getMyCommands"{}},\ \textcolor{stringliteral}{"{}"{}},\ \textcolor{keyword}{true}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00771}00771\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00772}00772\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}getMyCommands\ error\ "{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00773}00773\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00774}00774\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00775}00775\ \ \ \ \ StaticJsonDocument<BUFFER\_MEDIUM>\ doc;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00776}00776\ \ \ \ \ DeserializationError\ err\ =\ deserializeJson(doc,\ m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00777}00777\ \ \ \ \ \textcolor{keywordflow}{if}\ (err)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00778}00778\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00779}00779\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00780}00780\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00781}00781\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(doc,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00782}00782\ \ \ \ \ \textcolor{comment}{//\ cmdList\ =\ doc["{}result"{}].as<String>();}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00783}00783\ \ \ \ \ serializeJsonPretty(doc[\textcolor{stringliteral}{"{}result"{}}],\ cmdList);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00784}00784\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00785}00785\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00786}\mbox{\hyperlink{class_async_telegram2_a4ec850e59adae8852c90ced61d3845de}{00786}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a4ec850e59adae8852c90ced61d3845de}{AsyncTelegram2::deleteMyCommands}}()}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00787}00787\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00788}00788\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}deleteMyCommands"{}},\ \textcolor{stringliteral}{"{}"{}},\ \textcolor{keyword}{true}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00789}00789\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00790}00790\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}getMyCommands\ error\ "{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00791}00791\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00792}00792\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00793}00793\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00794}00794\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00795}00795\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00796}\mbox{\hyperlink{class_async_telegram2_a0a0c361a02fc19d233ae6136ccf781b3}{00796}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_a0a0c361a02fc19d233ae6136ccf781b3}{AsyncTelegram2::setMyCommands}}(\textcolor{keyword}{const}\ String\ \&cmd,\ \textcolor{keyword}{const}\ String\ \&desc)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00797}00797\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00798}00798\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00799}00799\ \ \ \ \ \textcolor{comment}{//\ get\ actual\ list\ of\ commands}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00800}00800\ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}getMyCommands"{}},\ \textcolor{stringliteral}{"{}"{}},\ \textcolor{keyword}{true}))}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00801}00801\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00802}00802\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a194d3ac058ef1c1146f12cc5ba1be3d3}{log\_error}}(\textcolor{stringliteral}{"{}getMyCommands\ error\ "{}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00803}00803\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00804}00804\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00805}00805\ \ \ \ \ DynamicJsonDocument\ doc(\mbox{\hyperlink{_data_structures_8h_a6c3da8213680f84f1ab89bdccde48fcd}{BUFFER\_MEDIUM}});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00806}00806\ \ \ \ \ DeserializationError\ err\ =\ deserializeJson(doc,\ m\_rxbuffer);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00807}00807\ \ \ \ \ \textcolor{keywordflow}{if}\ (err)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00808}00808\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00809}00809\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00810}00810\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00811}00811\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00812}00812\ \ \ \ \ \textcolor{comment}{//\ Check\ if\ command\ already\ present\ in\ list}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00813}00813\ \ \ \ \ \textcolor{keywordflow}{for}\ (JsonObject\ key\ :\ doc[\textcolor{stringliteral}{"{}result"{}}].as<JsonArray>())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00814}00814\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00815}00815\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (key[\textcolor{stringliteral}{"{}command"{}}]\ ==\ cmd)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00816}00816\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00817}00817\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00818}00818\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00819}00819\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00820}00820\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00821}00821\ \ \ \ \ StaticJsonDocument<256>\ obj;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00822}00822\ \ \ \ \ obj[\textcolor{stringliteral}{"{}command"{}}]\ =\ cmd;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00823}00823\ \ \ \ \ obj[\textcolor{stringliteral}{"{}description"{}}]\ =\ desc;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00824}00824\ \ \ \ \ doc[\textcolor{stringliteral}{"{}result"{}}].as<JsonArray>().add(obj);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00825}00825\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00826}00826\ \ \ \ \ StaticJsonDocument<BUFFER\_MEDIUM>\ doc2;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00827}00827\ \ \ \ \ doc2[\textcolor{stringliteral}{"{}commands"{}}]\ =\ doc[\textcolor{stringliteral}{"{}result"{}}].as<JsonArray>();}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00828}00828\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00829}00829\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ len\ =\ measureJson(doc2);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00830}00830\ \ \ \ \ \textcolor{keywordtype}{char}\ payload[len\ +\ 1];}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00831}00831\ \ \ \ \ serializeJson(doc2,\ payload,\ len);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00832}00832\ \ \ \ \ \mbox{\hyperlink{serial__log_8h_a34ec07116f1ed1ab676f439fb382cb5b}{debugJson}}(doc2,\ Serial);}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00833}00833\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00834}00834\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}setMyCommands"{}},\ payload,\ \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00835}00835\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00836}00836\ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00837}00837\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00838}\mbox{\hyperlink{class_async_telegram2_af5c03f30c18df9051ffb8052587f7372}{00838}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_async_telegram2_af5c03f30c18df9051ffb8052587f7372}{AsyncTelegram2::editMessage}}(int32\_t\ chat\_id,\ int32\_t\ message\_id,\ \textcolor{keyword}{const}\ String\ \&txt,\ \textcolor{keyword}{const}\ String\ \&keyboard)}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00839}00839\ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00840}00840\ \ \ \ \ String\ payload\ =\ \textcolor{stringliteral}{"{}\{\(\backslash\)"{}chat\_id\(\backslash\)"{}:"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00841}00841\ \ \ \ \ payload\ +=\ chat\_id;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00842}00842\ \ \ \ \ payload\ +=\ \textcolor{stringliteral}{"{},\(\backslash\)"{}message\_id\(\backslash\)"{}:"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00843}00843\ \ \ \ \ payload\ +=\ message\_id;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00844}00844\ \ \ \ \ payload\ +=\ \textcolor{stringliteral}{"{},\ \(\backslash\)"{}text\(\backslash\)"{}:\ \(\backslash\)"{}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00845}00845\ \ \ \ \ payload\ +=\ txt;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00846}00846\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00847}00847\ \ \ \ \ \textcolor{keywordflow}{if}\ (keyboard.length())}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00848}00848\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00849}00849\ \ \ \ \ \ \ \ \ payload\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)"{},\ \(\backslash\)"{}reply\_markup\(\backslash\)"{}:\ "{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00850}00850\ \ \ \ \ \ \ \ \ payload\ +=\ keyboard;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00851}00851\ \ \ \ \ \ \ \ \ payload\ +=\ \textcolor{stringliteral}{"{}\}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00852}00852\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00853}00853\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00854}00854\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00855}00855\ \ \ \ \ \ \ \ \ payload\ +=\ \textcolor{stringliteral}{"{}\(\backslash\)"{}\}"{}};}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00856}00856\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00857}00857\ }
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00858}00858\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \mbox{\hyperlink{class_async_telegram2_a79af0c98ff15bf120375cee7a1d820e5}{sendCommand}}(\textcolor{stringliteral}{"{}editMessageText"{}},\ payload.c\_str());}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00859}00859\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{_async_telegram2_8cpp_source_l00860}00860\ \}}

\end{DoxyCode}
