You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

331 lines
44 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>LibTgBotPP: example01.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">LibTgBotPP
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('example01_8cc_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">example01.cc</div> </div>
</div><!--header-->
<div class="contents">
<a href="example01_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="TelegramBot_8h.html">Telegram/TelegramBot.h</a>&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;termios.h&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="example01_8cc.html#a879c9d54cce72d602eb541ccdadb0ea6"> 33</a></span>&#160;<span class="preprocessor">#define WEBHOOK_URL &quot;https://&lt;your-web-server&gt;/cgi-bin/&lt;binary name&gt;&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="example01_8cc.html#a46ae855efe2974950d236ddeb7a7118a"> 34</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BOT_TOKEN &quot;&lt;your token&gt;&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63"> 35</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SSTR( x ) static_cast&lt; std::ostringstream &amp; &gt;(( std::ostringstream() &lt;&lt; std::dec &lt;&lt; x ) ).str()</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd"> 37</a></span>&#160;std::string <a class="code" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* cmd) {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; FILE* pipe = popen(cmd, <span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">if</span> (!pipe)</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">return</span> <span class="stringliteral">&quot;ERROR&quot;</span>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordtype">char</span> buffer[128];</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; std::string result = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keywordflow">while</span> (!feof(pipe)) {</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordflow">if</span> (fgets(buffer, 128, pipe) != NULL)</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; result += buffer;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; }</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; pclose(pipe);</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;}</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85"> 54</a></span>&#160;std::vector&lt;std::string&gt; <a class="code" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85">explode</a>( <span class="keyword">const</span> std::string &amp;delimiter, <span class="keyword">const</span> std::string &amp;str) {</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; std::vector&lt;std::string&gt; arr;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordtype">int</span> strleng = str.length();</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordtype">int</span> delleng = delimiter.length();</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">if</span> (delleng == 0)</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordflow">return</span> arr; <span class="comment">//no change</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordtype">int</span> i = 0;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordtype">int</span> k = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">while</span>(i &lt; strleng) {</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordtype">int</span> j = 0;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">while</span> ((i+j &lt; strleng) &amp;&amp; (j &lt; delleng) &amp;&amp; (str[i+j] == delimiter[j]))</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; j++;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> (j == delleng) {</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; arr.push_back(str.substr(k, i-k));</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; i += delleng;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; k = i;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; i++;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; }</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; arr.push_back(str.substr(k, i-k));</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">return</span> arr;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;}</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment">// Command methods (callbacks)</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="example01_8cc.html#a62e688e1f7e24b74a53a2bf7da93e5c1"> 82</a></span>&#160;std::string <a class="code" href="example01_8cc.html#a62e688e1f7e24b74a53a2bf7da93e5c1">start</a>(<a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> *tg, <a class="code" href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a> args) {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">return</span>(<span class="stringliteral">&quot;I am a simple Bot, written in C++\nHave fun.&quot;</span>);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;}</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d"> 87</a></span>&#160;std::string <a class="code" href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d">help</a>(<a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> *tg, <a class="code" href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a> args) {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; std::map&lt;std::string, Telegram::TCommand&gt;::iterator it;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; std::string help_list = <span class="stringliteral">&quot;Commands:\n&quot;</span>;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="namespaceTelegram.html#ad82f4bcddd3c7921e8842bb30170a1c2">Telegram::TCommandMap</a> command_map = tg-&gt;<a class="code" href="classTelegram_1_1TelegramBot.html#aae9aba06108ce34f9766199c6588e1d6">getCommandMap</a>();</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">for</span> (it = command_map.begin(); it != command_map.end(); it++) {</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; help_list = help_list + it-&gt;first + <span class="stringliteral">&quot;: &quot;</span> + it-&gt;second.help_text + <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; }</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">return</span>(help_list);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c"> 100</a></span>&#160;std::string <a class="code" href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c">whoami</a>(<a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> *tg, <a class="code" href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a> args) {</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">return</span>(<span class="stringliteral">&quot;Your ID is &quot;</span> + <a class="code" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63">SSTR</a>(tg-&gt;<a class="code" href="classTelegram_1_1TelegramBot.html#a7c54766f656974b35f03ea510d7b6a4f">getMessage</a>()-&gt;<a class="code" href="classTelegram_1_1Message.html#a18d5d0522058707134a3547f7288663e">getChat</a>()-&gt;<a class="code" href="classTelegram_1_1Chat.html#a4606d7a26be673bf83711f26e3cce85c">getId</a>()));</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;}</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5"> 105</a></span>&#160;std::string <a class="code" href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5">loadavg</a>(<a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> *tg, <a class="code" href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a> args) {</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordflow">return</span>(<a class="code" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a>(<span class="stringliteral">&quot;cat /proc/loadavg&quot;</span>));</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;}</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b"> 110</a></span>&#160;std::string <a class="code" href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b">proc</a>(<a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> *tg, <a class="code" href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a> args) {</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">return</span>(<a class="code" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a>(<span class="stringliteral">&quot;pstree&quot;</span>));</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;}</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="comment">// main function</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="example01_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627"> 116</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="example01_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv) {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; std::vector&lt;std::string&gt; sExploded = <a class="code" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85">explode</a>(<span class="stringliteral">&quot;.&quot;</span>, argv[0]);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// @TODO: Check if we are called as .cgi!</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">if</span> ((sExploded.size() &gt; 1) &amp;&amp; (sExploded[1] == <span class="stringliteral">&quot;cgi&quot;</span>)) {</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// Do bot stuff!</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; std::string line = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordflow">while</span>(std::cin) {</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; std::string s;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; std::getline(std::cin, s);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; line = line + s;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; }</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> tg(<a class="code" href="example01_8cc.html#a46ae855efe2974950d236ddeb7a7118a">BOT_TOKEN</a>);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// Set the commands</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="structTelegram_1_1TCommand.html">Telegram::TCommand</a> sc;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">&quot;/start&quot;</span>;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &amp;<a class="code" href="example01_8cc.html#a62e688e1f7e24b74a53a2bf7da93e5c1">start</a>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">&quot;This is the start command&quot;</span>;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">addCommand</a>(sc);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">&quot;/help&quot;</span>;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &amp;<a class="code" href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d">help</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">&quot;Shows you the commands this bot knows&quot;</span>;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">addCommand</a>(sc);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">&quot;/whoami&quot;</span>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &amp;<a class="code" href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c">whoami</a>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">&quot;Tells you your Telegram ID&quot;</span>;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">addCommand</a>(sc);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">&quot;/loadavg&quot;</span>;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &amp;<a class="code" href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5">loadavg</a>;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">&quot;Shows average load of the system this bot is running on&quot;</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">addCommand</a>(sc);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">&quot;/proc&quot;</span>;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &amp;<a class="code" href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b">proc</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">&quot;Shows the process list of the system the bot is running on&quot;</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">addCommand</a>(sc);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#af6fbb842f679b33dd8a60f94f82d7c81">processMessage</a>(line);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment">// Process options</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; std::string user_id = <span class="stringliteral">&quot;&quot;</span>; <span class="comment">// ID of the receiving user</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="preprocessor">#ifdef __arm__</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="preprocessor"></span> <span class="keywordtype">int</span> c;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="preprocessor"></span> <span class="keywordtype">char</span> c;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">while</span> ((c = getopt(argc, argv, <span class="stringliteral">&quot;u:&quot;</span>)) != -1) {</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordflow">switch</span>(c) {</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">case</span> <span class="charliteral">&#39;u&#39;</span>:</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; user_id = (std::string)optarg;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">case</span> <span class="charliteral">&#39;:&#39;</span>:</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; std::cerr &lt;&lt; optopt &lt;&lt; <span class="stringliteral">&quot; without argument&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; }</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">if</span> (user_id == <span class="stringliteral">&quot;&quot;</span>) {</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; std::cerr &lt;&lt; <span class="stringliteral">&quot;No user ID given!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">return</span> 1;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; }</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="comment">// Read from stdin</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keyword">struct </span>termios t;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; std::string s = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">if</span> (tcgetattr(STDIN_FILENO, &amp;t) &lt; 0) {</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">// If we have a text piped in, read from std::cin</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">while</span>(std::cin) {</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; std::string line;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; std::getline(std::cin, line);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; s = s + line + <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; }</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; s.erase(s.end()-1);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; }</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">if</span> (s != <span class="stringliteral">&quot;&quot;</span>) {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <a class="code" href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a> tg(<a class="code" href="example01_8cc.html#a46ae855efe2974950d236ddeb7a7118a">BOT_TOKEN</a>);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; tg.<a class="code" href="classTelegram_1_1TelegramBot.html#a1645dae5fdfb1437bb8976f44c237563">sendMessage</a>(s, user_id);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; }</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;}</div>
<div class="ttc" id="structTelegram_1_1TCommand_html_a1c051d162e478b9f98efafbeeed19f9b"><div class="ttname"><a href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">Telegram::TCommand::command</a></div><div class="ttdeci">std::string command</div><div class="ttdoc">The command, e.g. /help. </div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00026">TelegramBot.h:26</a></div></div>
<div class="ttc" id="example01_8cc_html_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="example01_8cc.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00116">example01.cc:116</a></div></div>
<div class="ttc" id="example01_8cc_html_ad80d7c455c0c87f879a92658ad28329d"><div class="ttname"><a href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d">help</a></div><div class="ttdeci">std::string help(Telegram::TelegramBot *tg, Telegram::TCommandLine args)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00087">example01.cc:87</a></div></div>
<div class="ttc" id="example01_8cc_html_a62e688e1f7e24b74a53a2bf7da93e5c1"><div class="ttname"><a href="example01_8cc.html#a62e688e1f7e24b74a53a2bf7da93e5c1">start</a></div><div class="ttdeci">std::string start(Telegram::TelegramBot *tg, Telegram::TCommandLine args)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00082">example01.cc:82</a></div></div>
<div class="ttc" id="example01_8cc_html_a0d2f37137ee1fd6ff4a0ef803849dd63"><div class="ttname"><a href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63">SSTR</a></div><div class="ttdeci">#define SSTR(x)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00035">example01.cc:35</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a1645dae5fdfb1437bb8976f44c237563"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a1645dae5fdfb1437bb8976f44c237563">Telegram::TelegramBot::sendMessage</a></div><div class="ttdeci">void sendMessage(std::string, Json::Int64)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00090">TelegramBot.cc:90</a></div></div>
<div class="ttc" id="example01_8cc_html_a316c9e2b99ca29094112ea9f4f131b85"><div class="ttname"><a href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85">explode</a></div><div class="ttdeci">std::vector&lt; std::string &gt; explode(const std::string &amp;delimiter, const std::string &amp;str)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00054">example01.cc:54</a></div></div>
<div class="ttc" id="structTelegram_1_1TCommand_html_a867f39a193fc9362da5b7111a655ae2b"><div class="ttname"><a href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">Telegram::TCommand::help_text</a></div><div class="ttdeci">std::string help_text</div><div class="ttdoc">Help text of the command. </div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00028">TelegramBot.h:28</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html_af6fbb842f679b33dd8a60f94f82d7c81"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#af6fbb842f679b33dd8a60f94f82d7c81">Telegram::TelegramBot::processMessage</a></div><div class="ttdeci">void processMessage(std::string)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00074">TelegramBot.cc:74</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html_aae9aba06108ce34f9766199c6588e1d6"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#aae9aba06108ce34f9766199c6588e1d6">Telegram::TelegramBot::getCommandMap</a></div><div class="ttdeci">std::map&lt; std::string, TCommand &gt; getCommandMap()</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00133">TelegramBot.cc:133</a></div></div>
<div class="ttc" id="structTelegram_1_1TCommand_html"><div class="ttname"><a href="structTelegram_1_1TCommand.html">Telegram::TCommand</a></div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00025">TelegramBot.h:25</a></div></div>
<div class="ttc" id="example01_8cc_html_a43b669bccb8bce8ea862a58a9dc116bd"><div class="ttname"><a href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a></div><div class="ttdeci">std::string exec(const char *cmd)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00037">example01.cc:37</a></div></div>
<div class="ttc" id="TelegramBot_8h_html"><div class="ttname"><a href="TelegramBot_8h.html">TelegramBot.h</a></div></div>
<div class="ttc" id="example01_8cc_html_aecdda2b4770f85617b26cf01e056354b"><div class="ttname"><a href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b">proc</a></div><div class="ttdeci">std::string proc(Telegram::TelegramBot *tg, Telegram::TCommandLine args)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00110">example01.cc:110</a></div></div>
<div class="ttc" id="structTelegram_1_1TCommand_html_a3f2c8ecbfd34be25baa577afee2e6e52"><div class="ttname"><a href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">Telegram::TCommand::callback</a></div><div class="ttdeci">CommandCallback callback</div><div class="ttdoc">Pointer to the callback function. </div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00027">TelegramBot.h:27</a></div></div>
<div class="ttc" id="example01_8cc_html_a127652392bff79b07e87fc7cfa88508c"><div class="ttname"><a href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c">whoami</a></div><div class="ttdeci">std::string whoami(Telegram::TelegramBot *tg, Telegram::TCommandLine args)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00100">example01.cc:100</a></div></div>
<div class="ttc" id="classTelegram_1_1Message_html_a18d5d0522058707134a3547f7288663e"><div class="ttname"><a href="classTelegram_1_1Message.html#a18d5d0522058707134a3547f7288663e">Telegram::Message::getChat</a></div><div class="ttdeci">Telegram::Chat * getChat()</div><div class="ttdef"><b>Definition:</b> <a href="Message_8cc_source.html#l00122">Message.cc:122</a></div></div>
<div class="ttc" id="namespaceTelegram_html_ad82f4bcddd3c7921e8842bb30170a1c2"><div class="ttname"><a href="namespaceTelegram.html#ad82f4bcddd3c7921e8842bb30170a1c2">Telegram::TCommandMap</a></div><div class="ttdeci">std::map&lt; std::string, TCommand &gt; TCommandMap</div><div class="ttdoc">Map that stores the known commands. </div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00030">TelegramBot.h:30</a></div></div>
<div class="ttc" id="namespaceTelegram_html_a97c1241696e3250bf462adae6b65a563"><div class="ttname"><a href="namespaceTelegram.html#a97c1241696e3250bf462adae6b65a563">Telegram::TCommandLine</a></div><div class="ttdeci">std::vector&lt; std::string &gt; TCommandLine</div><div class="ttdoc">Arguments for the bot&#39;s commands. </div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00017">TelegramBot.h:17</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a398bd76186e27d514afd835c5437c6ed"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">Telegram::TelegramBot::addCommand</a></div><div class="ttdeci">void addCommand(TCommand)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00044">TelegramBot.cc:44</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a7c54766f656974b35f03ea510d7b6a4f"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a7c54766f656974b35f03ea510d7b6a4f">Telegram::TelegramBot::getMessage</a></div><div class="ttdeci">Telegram::Message * getMessage()</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00128">TelegramBot.cc:128</a></div></div>
<div class="ttc" id="classTelegram_1_1Chat_html_a4606d7a26be673bf83711f26e3cce85c"><div class="ttname"><a href="classTelegram_1_1Chat.html#a4606d7a26be673bf83711f26e3cce85c">Telegram::Chat::getId</a></div><div class="ttdeci">Json::Int64 getId()</div><div class="ttdef"><b>Definition:</b> <a href="Chat_8cc_source.html#l00013">Chat.cc:13</a></div></div>
<div class="ttc" id="example01_8cc_html_a46ae855efe2974950d236ddeb7a7118a"><div class="ttname"><a href="example01_8cc.html#a46ae855efe2974950d236ddeb7a7118a">BOT_TOKEN</a></div><div class="ttdeci">#define BOT_TOKEN</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00034">example01.cc:34</a></div></div>
<div class="ttc" id="example01_8cc_html_aa93e480f3e6a877724767a4058c57ec5"><div class="ttname"><a href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5">loadavg</a></div><div class="ttdeci">std::string loadavg(Telegram::TelegramBot *tg, Telegram::TCommandLine args)</div><div class="ttdef"><b>Definition:</b> <a href="example01_8cc_source.html#l00105">example01.cc:105</a></div></div>
<div class="ttc" id="classTelegram_1_1TelegramBot_html"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html">Telegram::TelegramBot</a></div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00032">TelegramBot.h:32</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_c1e5849d565b56fca2010f6d30d9464c.html">examples</a></li><li class="navelem"><a class="el" href="example01_8cc.html">example01.cc</a></li>
<li class="footer">Generated on Sun Jun 4 2017 13:31:53 for LibTgBotPP by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>