1
0
mirror of synced 2024-11-22 20:46:03 +03:00
mg-bot-api-client-js/Client.html

3096 lines
31 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Client</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Client</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Client<span class="signature">()</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Client"><span class="type-signature"></span>new Client<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line3">line 3</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".assignDialog"><span class="type-signature">(static) </span>assignDialog<span class="signature">(dialog_id, dialog)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Assign dialog
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>dialog_id</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Dialog id</td>
</tr>
<tr>
<td class="name"><code>dialog</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Dialog object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line78">line 78</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".closeDialog"><span class="type-signature">(static) </span>closeDialog<span class="signature">(dialog_id)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Close dialog
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>dialog_id</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Dialog id</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".deleteCommand"><span class="type-signature">(static) </span>deleteCommand<span class="signature">(command_name)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Delete bot command
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>command_name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Command name</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line185">line 185</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".deleteMessage"><span class="type-signature">(static) </span>deleteMessage<span class="signature">(message_id)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Delete message
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message_id</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Message id</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line128">line 128</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".editCommand"><span class="type-signature">(static) </span>editCommand<span class="signature">(command_name, command)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Edit bot command
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>command_name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Command name</td>
</tr>
<tr>
<td class="name"><code>command</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Command object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line170">line 170</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".editMessage"><span class="type-signature">(static) </span>editMessage<span class="signature">(message_id, message)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Edit message
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message_id</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Message id</td>
</tr>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Message object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line144">line 144</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getBots"><span class="type-signature">(static) </span>getBots<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get bots
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for bots</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getChannels"><span class="type-signature">(static) </span>getChannels<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get channels
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for channels</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line26">line 26</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getChats"><span class="type-signature">(static) </span>getChats<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get chats
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for chats</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getCommands"><span class="type-signature">(static) </span>getCommands<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get bot commands
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for commands</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line158">line 158</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getCustomers"><span class="type-signature">(static) </span>getCustomers<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get customers
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for customers</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getDialogs"><span class="type-signature">(static) </span>getDialogs<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get dialogs
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for dialogs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line56">line 56</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getMembers"><span class="type-signature">(static) </span>getMembers<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get members
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for members</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line66">line 66</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getMessages"><span class="type-signature">(static) </span>getMessages<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get messages
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for messages</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line117">line 117</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getUsers"><span class="type-signature">(static) </span>getUsers<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Get users
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Filter's object for users</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line209">line 209</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".getWebsocketData"><span class="type-signature">(static) </span>getWebsocketData<span class="signature">(events)</span><span class="type-signature"> &rarr; {Map}</span></h4>
<div class="description">
Get websocket url
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>events</code></td>
<td class="type">
<span class="param-type">array.&lt;string></span>
</td>
<td class="description last">Array of strings with websocket events</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line220">line 220</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Map</span>
</dd>
</dl>
<h4 class="name" id=".info"><span class="type-signature">(static) </span>info<span class="signature">(data)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Bot information update
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Bot data</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line199">line 199</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id=".sendMessage"><span class="type-signature">(static) </span>sendMessage<span class="signature">(message)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
Send message
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Message object</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="v1_client.js.html">v1/client.js</a>, <a href="v1_client.js.html#line107">line 107</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Client.html">Client</a></li></ul><h3>Global</h3><ul><li><a href="global.html#messageScopePrivate">messageScopePrivate</a></li><li><a href="global.html#messageScopePublic">messageScopePublic</a></li><li><a href="global.html#msgTypeCommand">msgTypeCommand</a></li><li><a href="global.html#msgTypeFile">msgTypeFile</a></li><li><a href="global.html#msgTypeImage">msgTypeImage</a></li><li><a href="global.html#msgTypeOrder">msgTypeOrder</a></li><li><a href="global.html#msgTypeProduct">msgTypeProduct</a></li><li><a href="global.html#msgTypeSystem">msgTypeSystem</a></li><li><a href="global.html#msgTypeText">msgTypeText</a></li><li><a href="global.html#wsBotUpdated">wsBotUpdated</a></li><li><a href="global.html#wsChannelUpdated">wsChannelUpdated</a></li><li><a href="global.html#wsChatCreated">wsChatCreated</a></li><li><a href="global.html#wsChatUnreadUpdated">wsChatUnreadUpdated</a></li><li><a href="global.html#wsChatUpdated">wsChatUpdated</a></li><li><a href="global.html#wsCustomerUpdated">wsCustomerUpdated</a></li><li><a href="global.html#wsDialogAssign">wsDialogAssign</a></li><li><a href="global.html#wsDialogClosed">wsDialogClosed</a></li><li><a href="global.html#wsDialogOpened">wsDialogOpened</a></li><li><a href="global.html#wsMessageDeleted">wsMessageDeleted</a></li><li><a href="global.html#wsMessageNew">wsMessageNew</a></li><li><a href="global.html#wsMessageUpdated">wsMessageUpdated</a></li><li><a href="global.html#wsSettingsUpdated">wsSettingsUpdated</a></li><li><a href="global.html#wsUserJoinedChat">wsUserJoinedChat</a></li><li><a href="global.html#wsUserLeftChat">wsUserLeftChat</a></li><li><a href="global.html#wsUserOnlineUpdated">wsUserOnlineUpdated</a></li><li><a href="global.html#wsUserUpdated">wsUserUpdated</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 07 2019 08:12:08 GMT+0000 (UTC)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>