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.
332 lines
44 KiB
332 lines
44 KiB
8 years ago
|
<!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 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 List</span></a></li>
|
||
|
<li><a href="globals.html"><span>File 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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </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> </div>
|
||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <<a class="code" href="TelegramBot_8h.html">Telegram/TelegramBot.h</a>></span></div>
|
||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
|
||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <map></span></div>
|
||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <sstream></span></div>
|
||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <string></span></div>
|
||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <vector></span></div>
|
||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
|
||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <termios.h></span></div>
|
||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <stdbool.h></span></div>
|
||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <unistd.h></span></div>
|
||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
|
||
|
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="example01_8cc.html#a879c9d54cce72d602eb541ccdadb0ea6"> 33</a></span> <span class="preprocessor">#define WEBHOOK_URL "https://<your-web-server>/cgi-bin/<binary name>"</span></div>
|
||
|
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="example01_8cc.html#a46ae855efe2974950d236ddeb7a7118a"> 34</a></span> <span class="preprocessor"></span><span class="preprocessor">#define BOT_TOKEN "<your token>"</span></div>
|
||
|
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63"> 35</a></span> <span class="preprocessor"></span><span class="preprocessor">#define SSTR( x ) static_cast< std::ostringstream & >(( std::ostringstream() << std::dec << x ) ).str()</span></div>
|
||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <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> 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> </div>
|
||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  FILE* pipe = popen(cmd, <span class="stringliteral">"r"</span>);</div>
|
||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (!pipe)</div>
|
||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordflow">return</span> <span class="stringliteral">"ERROR"</span>;</div>
|
||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div>
|
||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordtype">char</span> buffer[128];</div>
|
||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  std::string result = <span class="stringliteral">""</span>;</div>
|
||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">while</span> (!feof(pipe)) {</div>
|
||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordflow">if</span> (fgets(buffer, 128, pipe) != NULL)</div>
|
||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  result += buffer;</div>
|
||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  }</div>
|
||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  pclose(pipe);</div>
|
||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
|
||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">return</span> result;</div>
|
||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> }</div>
|
||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||
|
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85"> 54</a></span> std::vector<std::string> <a class="code" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85">explode</a>( <span class="keyword">const</span> std::string &delimiter, <span class="keyword">const</span> std::string &str) {</div>
|
||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
|
||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  std::vector<std::string> arr;</div>
|
||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
|
||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordtype">int</span> strleng = str.length();</div>
|
||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordtype">int</span> delleng = delimiter.length();</div>
|
||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">if</span> (delleng == 0)</div>
|
||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <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> </div>
|
||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordtype">int</span> i = 0;</div>
|
||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordtype">int</span> k = 0;</div>
|
||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">while</span>(i < strleng) {</div>
|
||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordtype">int</span> j = 0;</div>
|
||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">while</span> ((i+j < strleng) && (j < delleng) && (str[i+j] == delimiter[j]))</div>
|
||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  j++;</div>
|
||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keywordflow">if</span> (j == delleng) {</div>
|
||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  arr.push_back(str.substr(k, i-k));</div>
|
||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  i += delleng;</div>
|
||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  k = i;</div>
|
||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  } <span class="keywordflow">else</span> {</div>
|
||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  i++;</div>
|
||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  }</div>
|
||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  }</div>
|
||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  arr.push_back(str.substr(k, i-k));</div>
|
||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordflow">return</span> arr;</div>
|
||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> }</div>
|
||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
|
||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <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> 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> </div>
|
||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span>(<span class="stringliteral">"I am a simple Bot, written in C++\nHave fun."</span>);</div>
|
||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> }</div>
|
||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||
|
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d"> 87</a></span> 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> </div>
|
||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  std::map<std::string, Telegram::TCommand>::iterator it;</div>
|
||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  std::string help_list = <span class="stringliteral">"Commands:\n"</span>;</div>
|
||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="namespaceTelegram.html#ad82f4bcddd3c7921e8842bb30170a1c2">Telegram::TCommandMap</a> command_map = tg-><a class="code" href="classTelegram_1_1TelegramBot.html#aae9aba06108ce34f9766199c6588e1d6">getCommandMap</a>();</div>
|
||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
|
||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <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>  help_list = help_list + it->first + <span class="stringliteral">": "</span> + it->second.help_text + <span class="stringliteral">"\n"</span>;</div>
|
||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div>
|
||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div>
|
||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">return</span>(help_list);</div>
|
||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> }</div>
|
||
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div>
|
||
|
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c"> 100</a></span> 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> </div>
|
||
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">return</span>(<span class="stringliteral">"Your ID is "</span> + <a class="code" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63">SSTR</a>(tg-><a class="code" href="classTelegram_1_1TelegramBot.html#a7c54766f656974b35f03ea510d7b6a4f">getMessage</a>()-><a class="code" href="classTelegram_1_1Message.html#a18d5d0522058707134a3547f7288663e">getChat</a>()-><a class="code" href="classTelegram_1_1Chat.html#a4606d7a26be673bf83711f26e3cce85c">getId</a>()));</div>
|
||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div>
|
||
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div>
|
||
|
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5"> 105</a></span> 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> </div>
|
||
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">return</span>(<a class="code" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a>(<span class="stringliteral">"cat /proc/loadavg"</span>));</div>
|
||
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div>
|
||
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div>
|
||
|
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b"> 110</a></span> 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> </div>
|
||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">return</span>(<a class="code" href="example01_8cc.html#a43b669bccb8bce8ea862a58a9dc116bd">exec</a>(<span class="stringliteral">"pstree"</span>));</div>
|
||
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div>
|
||
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <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> <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>  std::vector<std::string> sExploded = <a class="code" href="example01_8cc.html#a316c9e2b99ca29094112ea9f4f131b85">explode</a>(<span class="stringliteral">"."</span>, argv[0]);</div>
|
||
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div>
|
||
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <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>  <span class="keywordflow">if</span> ((sExploded.size() > 1) && (sExploded[1] == <span class="stringliteral">"cgi"</span>)) {</div>
|
||
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment">// Do bot stuff!</span></div>
|
||
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  std::string line = <span class="stringliteral">""</span>;</div>
|
||
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">while</span>(std::cin) {</div>
|
||
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  std::string s;</div>
|
||
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  std::getline(std::cin, s);</div>
|
||
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  line = line + s;</div>
|
||
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div>
|
||
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <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> </div>
|
||
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment">// Set the commands</span></div>
|
||
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <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>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/start"</span>;</div>
|
||
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &<a class="code" href="example01_8cc.html#a62e688e1f7e24b74a53a2bf7da93e5c1">start</a>;</div>
|
||
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">"This is the start command"</span>;</div>
|
||
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  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> </div>
|
||
|
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/help"</span>;</div>
|
||
|
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &<a class="code" href="example01_8cc.html#ad80d7c455c0c87f879a92658ad28329d">help</a>;</div>
|
||
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">"Shows you the commands this bot knows"</span>;</div>
|
||
|
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  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> </div>
|
||
|
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/whoami"</span>;</div>
|
||
|
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &<a class="code" href="example01_8cc.html#a127652392bff79b07e87fc7cfa88508c">whoami</a>;</div>
|
||
|
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">"Tells you your Telegram ID"</span>;</div>
|
||
|
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  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> </div>
|
||
|
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/loadavg"</span>;</div>
|
||
|
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &<a class="code" href="example01_8cc.html#aa93e480f3e6a877724767a4058c57ec5">loadavg</a>;</div>
|
||
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">"Shows average load of the system this bot is running on"</span>;</div>
|
||
|
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  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> </div>
|
||
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/proc"</span>;</div>
|
||
|
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a> = &<a class="code" href="example01_8cc.html#aecdda2b4770f85617b26cf01e056354b">proc</a>;</div>
|
||
|
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  sc.<a class="code" href="structTelegram_1_1TCommand.html#a867f39a193fc9362da5b7111a655ae2b">help_text</a> = <span class="stringliteral">"Shows the process list of the system the bot is running on"</span>;</div>
|
||
|
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  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> </div>
|
||
|
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  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> </div>
|
||
|
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  } <span class="keywordflow">else</span> {</div>
|
||
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="comment">// Process options</span></div>
|
||
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  std::string user_id = <span class="stringliteral">""</span>; <span class="comment">// ID of the receiving user</span></div>
|
||
|
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div>
|
||
|
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="preprocessor">#ifdef __arm__</span></div>
|
||
|
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="preprocessor"></span> <span class="keywordtype">int</span> c;</div>
|
||
|
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="preprocessor">#else</span></div>
|
||
|
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="preprocessor"></span> <span class="keywordtype">char</span> c;</div>
|
||
|
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="preprocessor">#endif</span></div>
|
||
|
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">while</span> ((c = getopt(argc, argv, <span class="stringliteral">"u:"</span>)) != -1) {</div>
|
||
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordflow">switch</span>(c) {</div>
|
||
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">case</span> <span class="charliteral">'u'</span>:</div>
|
||
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  user_id = (std::string)optarg;</div>
|
||
|
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">break</span>;</div>
|
||
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">case</span> <span class="charliteral">':'</span>:</div>
|
||
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  std::cerr << optopt << <span class="stringliteral">" without argument"</span> << std::endl;</div>
|
||
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">break</span>;</div>
|
||
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  }</div>
|
||
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div>
|
||
|
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div>
|
||
|
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">if</span> (user_id == <span class="stringliteral">""</span>) {</div>
|
||
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  std::cerr << <span class="stringliteral">"No user ID given!"</span> << std::endl;</div>
|
||
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">return</span> 1;</div>
|
||
|
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div>
|
||
|
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div>
|
||
|
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="comment">// Read from stdin</span></div>
|
||
|
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keyword">struct </span>termios t;</div>
|
||
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  std::string s = <span class="stringliteral">""</span>;</div>
|
||
|
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">if</span> (tcgetattr(STDIN_FILENO, &t) < 0) {</div>
|
||
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <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>  <span class="keywordflow">while</span>(std::cin) {</div>
|
||
|
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  std::string line;</div>
|
||
|
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  std::getline(std::cin, line);</div>
|
||
|
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  s = s + line + <span class="stringliteral">"\n"</span>;</div>
|
||
|
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  }</div>
|
||
|
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  s.erase(s.end()-1);</div>
|
||
|
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  }</div>
|
||
|
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div>
|
||
|
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">if</span> (s != <span class="stringliteral">""</span>) {</div>
|
||
|
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <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>  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>  }</div>
|
||
|
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div>
|
||
|
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  }</div>
|
||
|
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span> </div>
|
||
|
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">return</span> 0;</div>
|
||
|
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span> }</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< std::string > explode(const std::string &delimiter, const std::string &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< std::string, TCommand > 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< std::string, TCommand > 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< std::string > TCommandLine</div><div class="ttdoc">Arguments for the bot'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>
|