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.
363 lines
48 KiB
363 lines
48 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: TelegramBot.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('TelegramBot_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">TelegramBot.cc</div> </div> |
|
</div><!--header--> |
|
<div class="contents"> |
|
<a href="TelegramBot_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> <span class="preprocessor">#include "<a class="code" href="TelegramBot_8h.html">Telegram/TelegramBot.h</a>"</span></div> |
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> </div> |
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor">#include <iostream></span></div> |
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> </div> |
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include <curlpp/cURLpp.hpp></span></div> |
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <curlpp/Easy.hpp></span></div> |
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <curlpp/Infos.hpp></span></div> |
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include <curlpp/Options.hpp></span></div> |
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div> |
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="http__build__query_8h.html">http_build_query.h</a>"</span></div> |
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "<a class="code" href="json__encode_8h.html">json_encode.h</a>"</span></div> |
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include "<a class="code" href="std_8h.html">std.h</a>"</span></div> |
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div> |
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include "<a class="code" href="Message_8h.html">Telegram/Message.h</a>"</span></div> |
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="MessageEntity_8h.html">Telegram/MessageEntity.h</a>"</span></div> |
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div> |
|
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="TelegramBot_8cc.html#a47cbcc6d148fe0c8f9fb95966026aa97"> 17</a></span> <span class="preprocessor">#define API_URL "https://api.telegram.org/bot"</span></div> |
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor"></span></div> |
|
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a99b561e695953e6b69a3ddf6937a4811"> 22</a></span> <a class="code" href="classTelegram_1_1TelegramBot.html#a99b561e695953e6b69a3ddf6937a4811">Telegram::TelegramBot::TelegramBot</a>() {</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>  this-><a class="code" href="classTelegram_1_1TelegramBot.html#a1ca971ccfb242f7b8656eca3ab7666dd">api_url</a> = <span class="stringliteral">""</span>;</div> |
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  this-><a class="code" href="classTelegram_1_1TelegramBot.html#ae0d0fe5d54afcc9e6ee16b3d4f8ae895">init</a>();</div> |
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> }</div> |
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div> |
|
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a52f2a5f734bac5f83d2c0e5068618646"> 33</a></span> <a class="code" href="classTelegram_1_1TelegramBot.html#a99b561e695953e6b69a3ddf6937a4811">Telegram::TelegramBot::TelegramBot</a>(std::string token) {</div> |
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div> |
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  this->api_url = <a class="code" href="TelegramBot_8cc.html#a47cbcc6d148fe0c8f9fb95966026aa97">API_URL</a> + token + <span class="stringliteral">"/"</span>;</div> |
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  this->init();</div> |
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div> |
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div> |
|
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed"> 44</a></span> <span class="keywordtype">void</span> <a class="code" href="classTelegram_1_1TelegramBot.html#a398bd76186e27d514afd835c5437c6ed">Telegram::TelegramBot::addCommand</a>(<a class="code" href="structTelegram_1_1TCommand.html">TCommand</a> cmd) {</div> |
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div> |
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordflow">if</span> (cmd.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a>[0] != <span class="charliteral">'/'</span>) {</div> |
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  cmd.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a> = <span class="stringliteral">"/"</span> + cmd.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a>;</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>  this->command_map[cmd.<a class="code" href="structTelegram_1_1TCommand.html#a1c051d162e478b9f98efafbeeed19f9b">command</a>] = cmd;</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> </div> |
|
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#aabd1a825b1d7f127f15bf336b985d70d"> 60</a></span> <span class="keywordtype">void</span> <a class="code" href="classTelegram_1_1TelegramBot.html#aabd1a825b1d7f127f15bf336b985d70d">Telegram::TelegramBot::setWebhook</a>(std::string url) {</div> |
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div> |
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  std::map<std::string, std::string> params;</div> |
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div> |
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  params[<span class="stringliteral">"url"</span>] = url;</div> |
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  this->apiRequest(<span class="stringliteral">"setWebhook"</span>, params);</div> |
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> }</div> |
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div> |
|
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#af6fbb842f679b33dd8a60f94f82d7c81"> 74</a></span> <span class="keywordtype">void</span> <a class="code" href="classTelegram_1_1TelegramBot.html#af6fbb842f679b33dd8a60f94f82d7c81">Telegram::TelegramBot::processMessage</a>(std::string message) {</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>  this->msg = <span class="keyword">new</span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>(message);</div> |
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div> |
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="namespaceTelegram.html#aa7927193a64b09836112d3be24c45d85">Telegram::TMessageEntities</a> entities = this->msg->getEntities();</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>  <span class="keywordflow">if</span> (entities.size() && (entities[0]->getType() == <span class="stringliteral">"bot_command"</span>)) {</div> |
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  this->sendMessage(this->processCommand(this->msg->getText()), this->msg->getChat()->getId());</div> |
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  } <span class="keywordflow">else</span> {</div> |
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  this->sendMessage(<span class="stringliteral">"Hello "</span> + this->msg->getChat()->getUsername() + <span class="stringliteral">", you told me: '"</span> + msg->getText() + <span class="stringliteral">"'"</span>, this->msg->getChat()->getId());</div> |
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</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="classTelegram_1_1TelegramBot.html#a18326a958f926cdea62339899a29a1e1"> 87</a></span> <a class="code" href="classTelegram_1_1User.html">Telegram::User</a> *<a class="code" href="classTelegram_1_1TelegramBot.html#a18326a958f926cdea62339899a29a1e1">Telegram::TelegramBot::getMe</a>(<span class="keywordtype">void</span>) {</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>  Json::Value obj;</div> |
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  std::map<std::string, std::string> params;</div> |
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div> |
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  obj = this->apiRequestJson(<span class="stringliteral">"getMe"</span>, params);</div> |
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div> |
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">return</span>(<span class="keyword">new</span> <a class="code" href="classTelegram_1_1User.html">Telegram::User</a>(obj[<span class="stringliteral">"result"</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="l00100"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#acd21ba91f309c6d5fbcf7dc0063375ae"> 100</a></span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a> *<a class="code" href="classTelegram_1_1TelegramBot.html#acd21ba91f309c6d5fbcf7dc0063375ae">Telegram::TelegramBot::sendMessage</a>(std::string message, Json::Int64 chat_id) {</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>(this->sendMessage(message, <a class="code" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63">SSTR</a>(chat_id)));</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="l00108"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a592741f23db9675eb5e6ae60f6ee926b"> 108</a></span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>* <a class="code" href="classTelegram_1_1TelegramBot.html#acd21ba91f309c6d5fbcf7dc0063375ae">Telegram::TelegramBot::sendMessage</a>(std::string message, std::string chat_id) {</div> |
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div> |
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  std::map<std::string, std::string> params;</div> |
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  Json::Value obj;</div> |
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div> |
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  params[<span class="stringliteral">"chat_id"</span>] = chat_id;</div> |
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  params[<span class="stringliteral">"text"</span>] = message;</div> |
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div> |
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  obj = this->apiRequestJson(<span class="stringliteral">"sendMessage"</span>, params);</div> |
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div> |
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">return</span>(<span class="keyword">new</span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>(obj[<span class="stringliteral">"result"</span>]));</div> |
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> }</div> |
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div> |
|
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#adb9d623814ecbbeeefef4faa073b73c3"> 124</a></span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>* <a class="code" href="classTelegram_1_1TelegramBot.html#adb9d623814ecbbeeefef4faa073b73c3">Telegram::TelegramBot::sendPhoto</a>(std::string URL, Json::Int64 chat_id) {</div> |
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div> |
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">return</span>(this->sendPhoto(URL, <a class="code" href="example01_8cc.html#a0d2f37137ee1fd6ff4a0ef803849dd63">SSTR</a>(chat_id)));</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> </div> |
|
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a1f3a5159b2868b2aa7a84f3ca8f0104c"> 132</a></span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>* <a class="code" href="classTelegram_1_1TelegramBot.html#adb9d623814ecbbeeefef4faa073b73c3">Telegram::TelegramBot::sendPhoto</a>(std::string URL, std::string chat_id) {</div> |
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div> |
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  Json::Value obj;</div> |
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div> |
|
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  std::map<std::string, std::string> params;</div> |
|
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> </div> |
|
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  params[<span class="stringliteral">"chat_id"</span>] = chat_id;</div> |
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  params[<span class="stringliteral">"photo"</span>] = URL;</div> |
|
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div> |
|
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  obj = this->apiRequestJson(<span class="stringliteral">"sendPhoto"</span>, params);</div> |
|
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div> |
|
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordflow">return</span>(<span class="keyword">new</span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a>(obj[<span class="stringliteral">"result"</span>]));</div> |
|
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> }</div> |
|
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div> |
|
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a7c54766f656974b35f03ea510d7b6a4f"> 146</a></span> <a class="code" href="classTelegram_1_1Message.html">Telegram::Message</a> *<a class="code" href="classTelegram_1_1TelegramBot.html#a7c54766f656974b35f03ea510d7b6a4f">Telegram::TelegramBot::getMessage</a>() {</div> |
|
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div> |
|
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">return</span>(this->msg);</div> |
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> }</div> |
|
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div> |
|
<div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#aae9aba06108ce34f9766199c6588e1d6"> 151</a></span> <a class="code" href="namespaceTelegram.html#ad82f4bcddd3c7921e8842bb30170a1c2">Telegram::TCommandMap</a> <a class="code" href="classTelegram_1_1TelegramBot.html#aae9aba06108ce34f9766199c6588e1d6">Telegram::TelegramBot::getCommandMap</a>() {</div> |
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div> |
|
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">return</span>(this->command_map);</div> |
|
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> }</div> |
|
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div> |
|
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// Private methods</span></div> |
|
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#ae0d0fe5d54afcc9e6ee16b3d4f8ae895"> 157</a></span> <span class="keywordtype">void</span> <a class="code" href="classTelegram_1_1TelegramBot.html#ae0d0fe5d54afcc9e6ee16b3d4f8ae895">Telegram::TelegramBot::init</a>() {</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>  std::cout << <span class="stringliteral">"Content-type: text/html\r\n\r\n"</span> << std::endl;</div> |
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> }</div> |
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div> |
|
<div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#a7e07f1ca99390958ef5c6c95cbf18258"> 165</a></span> <span class="keywordtype">void</span> <a class="code" href="classTelegram_1_1TelegramBot.html#a7e07f1ca99390958ef5c6c95cbf18258">Telegram::TelegramBot::apiRequest</a>(std::string method, std::map<std::string, std::string> parameters) {</div> |
|
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div> |
|
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  parameters[<span class="stringliteral">"method"</span>] = method;</div> |
|
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div> |
|
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  Json::Value jValues;</div> |
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  Json::StyledWriter w;</div> |
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div> |
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keywordflow">for</span>(std::map<std::string, std::string>::iterator it = parameters.begin(); it != parameters.end(); ++it) {</div> |
|
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  jValues[(*it).first] = (*it).second;</div> |
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  }</div> |
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div> |
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">try</span> {</div> |
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  cURLpp::Easy handle;</div> |
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  std::string url = this->api_url + method + <span class="stringliteral">"?"</span> + <a class="code" href="http__build__query_8cc.html#a1e3cd58bbf46d30f168bbc0ee5cc486b">http_build_query</a>(parameters);</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>  handle.setOpt(cURLpp::Options::Url(url));</div> |
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  handle.setOpt(cURLpp::Options::ConnectTimeout(5));</div> |
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  handle.setOpt(cURLpp::Options::Timeout(60));</div> |
|
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  handle.perform(); <span class="comment">// Do the curl request</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="keywordtype">int</span> code;</div> |
|
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  code = cURLpp::Infos::ResponseCode::get(handle);</div> |
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  }</div> |
|
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">catch</span>(cURLpp::LogicError &e) {</div> |
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</div> |
|
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  }</div> |
|
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">catch</span>(cURLpp::RuntimeError &e) {</div> |
|
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</div> |
|
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  }</div> |
|
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">catch</span>(std::exception &e) {</div> |
|
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</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> </div> |
|
<div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#aba249898870b8250da0ac67ba6a55e88"> 202</a></span> Json::Value <a class="code" href="classTelegram_1_1TelegramBot.html#aba249898870b8250da0ac67ba6a55e88">Telegram::TelegramBot::apiRequestJson</a>(std::string method, std::map<std::string, std::string> parameters) {</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>  std::stringstream result; <span class="comment">// Stores the result of the api call</span></div> |
|
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  parameters[<span class="stringliteral">"method"</span>] = method;</div> |
|
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span> </div> |
|
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">try</span> {</div> |
|
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  cURLpp::Easy handle;</div> |
|
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  std::list<std::string> header;</div> |
|
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  header.push_back(<span class="stringliteral">"Content-Type: application/json"</span>);</div> |
|
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div> |
|
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  handle.setOpt(cURLpp::Options::Url(this->api_url));</div> |
|
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  handle.setOpt(cURLpp::Options::ConnectTimeout(5));</div> |
|
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  handle.setOpt(cURLpp::Options::Timeout(60));</div> |
|
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  handle.setOpt(cURLpp::Options::HttpHeader(header));</div> |
|
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  handle.setOpt(cURLpp::Options::PostFields(<a class="code" href="json__encode_8cc.html#ad8ce82c71c39fc700005394fccc714e2">json_encode</a>(parameters)));</div> |
|
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  handle.setOpt(cURLpp::Options::WriteStream(&result));</div> |
|
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div> |
|
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  handle.perform(); <span class="comment">// Do the curl request</span></div> |
|
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  }</div> |
|
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">catch</span>(cURLpp::LogicError &e) {</div> |
|
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</div> |
|
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  }</div> |
|
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">catch</span>(cURLpp::RuntimeError &e) {</div> |
|
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</div> |
|
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  }</div> |
|
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordflow">catch</span>(std::exception &e) {</div> |
|
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <a class="code" href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a>(e.what());</div> |
|
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  }</div> |
|
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> </div> |
|
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  Json::Reader jreader;</div> |
|
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  Json::Value obj;</div> |
|
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  jreader.parse(result.str(), obj);</div> |
|
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span> </div> |
|
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">return</span> (obj);</div> |
|
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span> }</div> |
|
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div> |
|
<div class="line"><a name="l00238"></a><span class="lineno"><a class="line" href="classTelegram_1_1TelegramBot.html#aed4dd1ce506259c0e82f0c46fe125ca4"> 238</a></span> std::string <a class="code" href="classTelegram_1_1TelegramBot.html#aed4dd1ce506259c0e82f0c46fe125ca4">Telegram::TelegramBot::processCommand</a>(std::string cmd) {</div> |
|
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div> |
|
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="comment">// Process command</span></div> |
|
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  std::string sCommand;</div> |
|
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  std::string sResult;</div> |
|
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  std::vector<std::string> vCmdLine = <a class="code" href="std_8cc.html#ae7427d6dcae9b9190db26d2e1b6700af">split</a>(cmd, <span class="charliteral">' '</span>);</div> |
|
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div> |
|
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">if</span>((vCmdLine.size() > 0) && (this->command_map.find(vCmdLine[0]) != this->command_map.end())) {</div> |
|
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  sCommand = vCmdLine[0];</div> |
|
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  vCmdLine.erase(vCmdLine.begin()); <span class="comment">// First value is the command itself</span></div> |
|
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <a class="code" href="structTelegram_1_1TCommand.html">TCommand</a> cs = this->command_map[sCommand];</div> |
|
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  sResult = (*cs.<a class="code" href="structTelegram_1_1TCommand.html#a3f2c8ecbfd34be25baa577afee2e6e52">callback</a>)(<span class="keyword">this</span>, vCmdLine);</div> |
|
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  } <span class="keywordflow">else</span> {</div> |
|
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  sResult = <span class="stringliteral">"Unknown command"</span>;</div> |
|
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  }</div> |
|
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div> |
|
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">return</span>(sResult);</div> |
|
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> }</div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_ae0d0fe5d54afcc9e6ee16b3d4f8ae895"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#ae0d0fe5d54afcc9e6ee16b3d4f8ae895">Telegram::TelegramBot::init</a></div><div class="ttdeci">void init()</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00157">TelegramBot.cc:157</a></div></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#l00027">TelegramBot.h:27</a></div></div> |
|
<div class="ttc" id="Message_8h_html"><div class="ttname"><a href="Message_8h.html">Message.h</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_1Message_html"><div class="ttname"><a href="classTelegram_1_1Message.html">Telegram::Message</a></div><div class="ttdef"><b>Definition:</b> <a href="Message_8h_source.html#l00027">Message.h:27</a></div></div> |
|
<div class="ttc" id="std_8cc_html_ae7427d6dcae9b9190db26d2e1b6700af"><div class="ttname"><a href="std_8cc.html#ae7427d6dcae9b9190db26d2e1b6700af">split</a></div><div class="ttdeci">std::vector< std::string > split(const std::string &text, char sep)</div><div class="ttdef"><b>Definition:</b> <a href="std_8cc_source.html#l00042">std.cc:42</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a18326a958f926cdea62339899a29a1e1"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a18326a958f926cdea62339899a29a1e1">Telegram::TelegramBot::getMe</a></div><div class="ttdeci">Telegram::User * getMe(void)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00087">TelegramBot.cc:87</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_aabd1a825b1d7f127f15bf336b985d70d"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#aabd1a825b1d7f127f15bf336b985d70d">Telegram::TelegramBot::setWebhook</a></div><div class="ttdeci">void setWebhook(std::string)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00060">TelegramBot.cc:60</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_a7e07f1ca99390958ef5c6c95cbf18258"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a7e07f1ca99390958ef5c6c95cbf18258">Telegram::TelegramBot::apiRequest</a></div><div class="ttdeci">void apiRequest(std::string, std::map< std::string, std::string >)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00165">TelegramBot.cc:165</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#l00151">TelegramBot.cc:151</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_aed4dd1ce506259c0e82f0c46fe125ca4"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#aed4dd1ce506259c0e82f0c46fe125ca4">Telegram::TelegramBot::processCommand</a></div><div class="ttdeci">std::string processCommand(std::string)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00238">TelegramBot.cc:238</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#l00026">TelegramBot.h:26</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="http__build__query_8h_html"><div class="ttname"><a href="http__build__query_8h.html">http_build_query.h</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a99b561e695953e6b69a3ddf6937a4811"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a99b561e695953e6b69a3ddf6937a4811">Telegram::TelegramBot::TelegramBot</a></div><div class="ttdeci">TelegramBot()</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00022">TelegramBot.cc:22</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#l00028">TelegramBot.h:28</a></div></div> |
|
<div class="ttc" id="std_8cc_html_a55fa50be9360d756a7cf448d7e9e0cc9"><div class="ttname"><a href="std_8cc.html#a55fa50be9360d756a7cf448d7e9e0cc9">Log</a></div><div class="ttdeci">void Log(std::string msg)</div><div class="ttdef"><b>Definition:</b> <a href="std_8cc_source.html#l00091">std.cc:91</a></div></div> |
|
<div class="ttc" id="std_8h_html"><div class="ttname"><a href="std_8h.html">std.h</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#l00031">TelegramBot.h:31</a></div></div> |
|
<div class="ttc" id="TelegramBot_8cc_html_a47cbcc6d148fe0c8f9fb95966026aa97"><div class="ttname"><a href="TelegramBot_8cc.html#a47cbcc6d148fe0c8f9fb95966026aa97">API_URL</a></div><div class="ttdeci">#define API_URL</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00017">TelegramBot.cc: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#l00146">TelegramBot.cc:146</a></div></div> |
|
<div class="ttc" id="MessageEntity_8h_html"><div class="ttname"><a href="MessageEntity_8h.html">MessageEntity.h</a></div></div> |
|
<div class="ttc" id="namespaceTelegram_html_aa7927193a64b09836112d3be24c45d85"><div class="ttname"><a href="namespaceTelegram.html#aa7927193a64b09836112d3be24c45d85">Telegram::TMessageEntities</a></div><div class="ttdeci">std::vector< Telegram::MessageEntity * > TMessageEntities</div><div class="ttdef"><b>Definition:</b> <a href="MessageEntity_8h_source.html#l00023">MessageEntity.h:23</a></div></div> |
|
<div class="ttc" id="json__encode_8h_html"><div class="ttname"><a href="json__encode_8h.html">json_encode.h</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1User_html"><div class="ttname"><a href="classTelegram_1_1User.html">Telegram::User</a></div><div class="ttdef"><b>Definition:</b> <a href="User_8h_source.html#l00009">User.h:9</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_aba249898870b8250da0ac67ba6a55e88"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#aba249898870b8250da0ac67ba6a55e88">Telegram::TelegramBot::apiRequestJson</a></div><div class="ttdeci">Json::Value apiRequestJson(std::string, std::map< std::string, std::string >)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00202">TelegramBot.cc:202</a></div></div> |
|
<div class="ttc" id="http__build__query_8cc_html_a1e3cd58bbf46d30f168bbc0ee5cc486b"><div class="ttname"><a href="http__build__query_8cc.html#a1e3cd58bbf46d30f168bbc0ee5cc486b">http_build_query</a></div><div class="ttdeci">std::string http_build_query(std::map< std::string, std::string > data)</div><div class="ttdef"><b>Definition:</b> <a href="http__build__query_8cc_source.html#l00003">http_build_query.cc:3</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_adb9d623814ecbbeeefef4faa073b73c3"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#adb9d623814ecbbeeefef4faa073b73c3">Telegram::TelegramBot::sendPhoto</a></div><div class="ttdeci">Telegram::Message * sendPhoto(std::string, Json::Int64)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00124">TelegramBot.cc:124</a></div></div> |
|
<div class="ttc" id="json__encode_8cc_html_ad8ce82c71c39fc700005394fccc714e2"><div class="ttname"><a href="json__encode_8cc.html#ad8ce82c71c39fc700005394fccc714e2">json_encode</a></div><div class="ttdeci">std::string json_encode(std::map< std::string, std::string > parameters)</div><div class="ttdef"><b>Definition:</b> <a href="json__encode_8cc_source.html#l00003">json_encode.cc:3</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_acd21ba91f309c6d5fbcf7dc0063375ae"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#acd21ba91f309c6d5fbcf7dc0063375ae">Telegram::TelegramBot::sendMessage</a></div><div class="ttdeci">Telegram::Message * sendMessage(std::string, Json::Int64)</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8cc_source.html#l00100">TelegramBot.cc:100</a></div></div> |
|
<div class="ttc" id="classTelegram_1_1TelegramBot_html_a1ca971ccfb242f7b8656eca3ab7666dd"><div class="ttname"><a href="classTelegram_1_1TelegramBot.html#a1ca971ccfb242f7b8656eca3ab7666dd">Telegram::TelegramBot::api_url</a></div><div class="ttdeci">std::string api_url</div><div class="ttdef"><b>Definition:</b> <a href="TelegramBot_8h_source.html#l00055">TelegramBot.h:55</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_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="TelegramBot_8cc.html">TelegramBot.cc</a></li> |
|
<li class="footer">Generated on Tue Jun 6 2017 14:48:45 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>
|
|
|