You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/objects/Bot.rst
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,20 @@ This object represents a Telegram bot.
7
7
The Bot object and its attributes should remain unchanged after it has been initialized.
8
8
9
9
10
-
.. js:class::Bot(token)
10
+
.. js:class::Bot(token[, options])
11
11
12
12
:param string token: A valid token for the Telegram Bot API
13
+
:param object options: *Optional*
13
14
:returns: A Bot object
14
15
15
16
Creates a new Bot object and fetches basic information about it (aysncronous call to Telegram's ``getMe`` method).
17
+
Valid ``options`` are:
18
+
19
+
.. code-block:: javascript
20
+
21
+
{
22
+
profiles_path: __dirname +'/profiles.json'
23
+
}
16
24
17
25
.. _init:
18
26
.. js:function::init()
@@ -215,4 +223,9 @@ This object represents a Telegram bot.
215
223
:param string action: Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
216
224
:returns: A promise that resolves to the response (according to Telegram, true on success).
217
225
226
+
.. js:function::broadcast(filter, callback)
227
+
228
+
:param string filter: Must be one of the following: ``private``, ``group``, ``supergroup``, ``channel`` or ``all``. Can also be a function that accepts one argument (a :doc:`Chat` object without functions) and returns a boolean value
229
+
:param function callback: A function to which is provided a single argument, a promise that resolves to a :doc:`Chat` object.
218
230
231
+
Iterates a function through all of chats stored in the profiles storage.
0 commit comments