Skip to content
This repository was archived by the owner on Aug 25, 2023. It is now read-only.

Commit 26d096f

Browse files
committed
Sphinx domains
1 parent 538015a commit 26d096f

File tree

11 files changed

+323
-477
lines changed

11 files changed

+323
-477
lines changed

docs/objects/Bot.rst

Lines changed: 137 additions & 191 deletions
Large diffs are not rendered by default.

docs/objects/CallbackQuery.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,18 @@ This object represents a Telegram callback query.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#callbackquery>`_.
99

10-
==========================
11-
CallbackQuery(object, bot)
12-
==========================
10+
.. js:class:: CallbackQuery(object, bot)
1311

1412
.. warning::
1513

1614
This constructor should be for internal use only.
1715

1816
Creates a new CallbackQuery object.
1917

20-
================================
21-
answerCallbackQuery(text, alert)
22-
================================
18+
.. js:function:: answerCallbackQuery(text, alert)
2319

24-
* ``text`` <String>
25-
* ``alert`` <Boolean> Whether the user should be shown an alert
20+
:param string text:
21+
:param boolean alert: Whether the user should be shown an alert
22+
:returns: A promise that resolves to the response (according to Telegram, true on success).
2623

27-
Answers the query and returns a promise that resolves to the response (according to Telegram, true on success).
24+
Answers the query.

docs/objects/Chat.rst

Lines changed: 61 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -7,138 +7,109 @@ This object represents a Telegram chat.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#chat>`_
99

10-
=================
11-
Chat(object, bot)
12-
=================
10+
.. js:class:: Chat(object, bot)
1311

1412
.. warning::
1513

1614
This constructor should be for internal use only.
1715

1816
Creates a new Chat object.
1917

20-
=======
21-
leave()
22-
=======
18+
.. js:function:: leave()
2319

24-
Leaves the chat and returns a promise that resolves to the response (according to Telegram, true on success).
20+
:returns: A promise that resolves to the response (according to Telegram, true on success).
2521

26-
==========================
27-
sendMessage(text, options)
28-
==========================
22+
Leaves the chat.
2923

30-
* ``text`` <String>
31-
* ``options`` <Object> *Optional*
24+
.. js:function:: sendMessage(text[, options])
3225

33-
Sends a message to the chat and returns a promise that resolves to a :doc:`Message` object representing what has been sent.
26+
:param string text:
27+
:param object options: *Optional*
28+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
3429

35-
==========================================
36-
sendLocation(longitude, latitude, options)
37-
==========================================
30+
Sends a message to the chat.
3831

39-
* ``longitude`` <Number>
40-
* ``latitude`` <Number>
41-
* ``options`` <Object> *Optional*
32+
.. js:function:: sendLocation(longitude, latitude[, options])
4233

43-
Sends a location object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
44-
been sent.
34+
:param number longitude:
35+
:param number latitude:
36+
:param object options: *Optional*
37+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
4538

46-
=======================================================
47-
sendVenue(longitude, latitude, title, address, options)
48-
=======================================================
39+
Sends a location object to the chat.
4940

50-
* ``longitude`` <Number>
51-
* ``latitude`` <Number>
52-
* ``title`` <String>
53-
* ``address`` <String>
54-
* ``options`` <Object> *Optional*
41+
.. js:function:: sendVenue(longitude, latitude, title, address[, options])
5542

56-
Sends a venue object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
57-
been sent.
43+
:param number longitude:
44+
:param number latitude:
45+
:param string title:
46+
:param string address:
47+
:param object options: *Optional*
48+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
5849

59-
==============================================
60-
sendContact(phone_number, first_name, options)
61-
==============================================
50+
Sends a venue object to the chat.
6251

63-
* ``phone_number`` <String>
64-
* ``first_name`` <String>
65-
* ``options`` <Object> *Optional*
52+
.. js:function:: sendContact(phone_number, first_name[, options])
6653

67-
Sends a contact object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
68-
been sent.
54+
:param string phone_number:
55+
:param string first_name:
56+
:param object options: *Optional*
57+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
6958

70-
=================================================
71-
forwardMessage(from_chat_id, message_id, options)
72-
=================================================
59+
Sends a contact object to the chat.
7360

74-
* ``from_chat_id`` <String>
75-
* ``message_id`` <String>
76-
* ``options`` <Object> *Optional*
61+
.. js:function:: forwardMessage(from_chat_id, message_id[, options])
7762

78-
Forwards a message to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
79-
been sent.
63+
:param string from_chat_id:
64+
:param string message_id:
65+
:param object options: *Optional*
66+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
8067

81-
=============================
82-
sendFile(type, path, options)
83-
=============================
8468

85-
* ``type`` <String> Must be one of the following: ``photo``, ``audio``, ``sticker``, ``document``, ``video``, ``voice``
86-
* ``path`` <String> File's path for local files or file's id for uploaded files
87-
* ``options`` <Object> *Optional*
69+
Forwards a message to the chat.
8870

89-
Sends the specified file to the chat and returns a promise that resolves to a :doc:`Message` object representing
90-
what has been sent.
71+
.. js:function:: sendFile(type, path[, options])
9172

92-
===================
93-
getAdministrators()
94-
===================
73+
:param string type: <String> Must be one of the following: ``photo``, ``audio``, ``sticker``, ``document``, ``video``, ``voice``
74+
:param string path: File's path for local files or file's id for uploaded files
75+
:param object options: *Optional*
76+
:returns: A promise that resolves to a :doc:`Message` object representing what has been sent.
9577

96-
* ``chat_id`` <String>|<Chat>
78+
Sends the specified file to the chat.
9779

98-
Returns a promise that resolves to an array of :doc:`ChatMember` objects.
80+
.. js:function:: getAdministrators()
9981

100-
==================
101-
getMember(user_id)
102-
==================
82+
Returns a promise that resolves to an array of :doc:`ChatMember` objects.
10383

104-
* ``user_id`` <String>|<User>
84+
.. js:function:: getMember(user_id)
10585

106-
Returns a promise that resolves to a :doc:`ChatMember` object.
86+
:param string user_id: Can also be a :doc:`User` object
10787

108-
===================
109-
kickMember(user_id)
110-
===================
88+
Returns a promise that resolves to a :doc:`ChatMember` object.
11189

112-
* ``user_id`` <String>|<User>
90+
.. js:function:: kickMember(user_id)
11391

114-
Kicks the specified user from the chat and returns a promise that resolves to the response (according to
115-
Telegram, true on success).
92+
:param string user_id: Can also be a :doc:`User` object
93+
:returns: A promise that resolves to the response (according to Telegram, true on success).
11694

117-
====================
118-
unbanMember(user_id)
119-
====================
95+
Kicks the specified user from the chat.
12096

121-
* ``user_id`` <String>|<User>
97+
.. js:function:: unbanMember(user_id)
12298

123-
Unbans the specified user from the chat and returns a promise that resolves to the response (according to
124-
Telegram, true on success).
99+
:param string user_id: Can also be a :doc:`User` object
100+
:returns: A promise that resolves to the response (according to Telegram, true on success).
125101

126-
=================
127-
getMembersCount()
128-
=================
102+
Unbans the specified user from the chat.
129103

130-
Returns a promise that resolves to the response.
104+
.. js:function:: getMembersCount()
131105

132-
==================
133-
sendAction(action)
134-
==================
106+
:returns: A promise that resolves to the response.
135107

136-
* ``action`` <String> Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
108+
.. js:function:: sendAction(action)
137109

138-
Returns a promise that resolves to the response (true on success).
110+
:param string action: <String> Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
111+
:returns: A promise that resolves to the response (true on success).
139112

140-
====
141-
name
142-
====
113+
.. js:attribute:: Chat.name
143114

144-
<String> *Optional*. The full name of the chat (first name + last name) if available
115+
*Optional*. The full name of the chat (first name + last name) if available

docs/objects/ChatMember.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ This object represents a Telegram chat member.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#chatmember>`_.
99

10-
=======================
11-
ChatMember(object, bot)
12-
=======================
10+
.. js:class:: ChatMember(object, bot)
1311

1412
.. warning::
1513

docs/objects/ChosenInlineResult.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ This object represents a Telegram chosen inline query result.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#choseninlineresult>`_.
99

10-
===============================
11-
ChosenInlineResult(object, bot)
12-
===============================
10+
.. js:class:: ChosenInlineResult(object, bot)
1311

1412
.. warning::
1513

docs/objects/File.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ This object represents a Telegram file.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#file>`_.
99

10-
=================
11-
File(object, bot)
12-
=================
10+
.. js:class:: File(object, bot)
11+
1312

1413
.. warning::
1514

1615
This constructor should be for internal use only.
1716

1817
Creates a new File object.
1918

20-
==========
21-
download()
22-
==========
19+
.. js:function:: download()
2320

24-
Returns a promise that resolves to a NodeJS `Buffer <https://nodejs.org/api/buffer.html>`_.
21+
:returns: A promise that resolves to a NodeJS `Buffer <https://nodejs.org/api/buffer.html>`_.

docs/objects/InlineQuery.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@ This object represents a Telegram inline query.
77

88
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#inlinequery>`_.
99

10-
========================
11-
InlineQuery(object, bot)
12-
========================
10+
.. js:class:: InlineQuery(object, bot)
1311

1412
.. warning::
1513

1614
This constructor should be for internal use only.
1715

1816
Creates a new InlineQuery object.
1917

20-
========================
21-
answer(results, options)
22-
========================
18+
.. js:function:: answer(results, options)
2319

24-
* ``results`` <Array> Array of InlineQueryResult
25-
* ``options`` <Object> *Optional*
20+
:param array results: Array of InlineQueryResult's
21+
:param object options: *Optional*
22+
:returns: A promise that resolves to the response (according to Telegram, true on success).
2623

27-
Answers the inline query with the specified results and returns a promise that resolves to the response (according to
28-
Telegram, true on success).
24+
Answers the inline query with the specified results.

docs/objects/Keyboard.rst

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,27 @@ Keyboard
33

44
This object represents Telegram's reply and inline keyboard markups.
55

6-
==========================
7-
Message(keyboard, options)
8-
==========================
6+
.. js:class:: Keyboard([keyboard, options])
97

10-
* ``keyboard`` <Array> Array of arrays of buttons, each one representing a row
11-
* ``options`` <Object> *Optional* Optional fields for both reply and inline keyboards, as defined by the Telegram API.
8+
:param array keyboard: *Optional* Array of arrays of buttons, each one representing a row.
9+
:param object options: *Optional* Optional fields for both reply and inline keyboards, as defined by the Telegram API.
1210

13-
=============================
14-
addButton(row, index, button)
15-
=============================
11+
.. js:function:: addButton(row, index, button)
1612

17-
* ``row`` <Number>
18-
* ``index`` <Number> The place of the button on the row. **Make sure that all preceding positions are filled!**
19-
* ``button`` <String>|<Object>
13+
:param number row:
14+
:param number index: The place of the button on the row. **Make sure that all preceding positions are filled!**
15+
:param string button: Can also be an object.
2016

21-
Adds a button to the keyboard. The ``button`` argument can both be a string (i.e. the text of the button, works only for
22-
reply keyboards) or an object with the corresponding properties (`inline <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_
23-
and `reply <https://core.telegram.org/bots/api#keyboardbutton>`_ keyboards)
17+
Adds a button to the keyboard. The ``button`` argument can both be a string (i.e. the text of the button, works only for
18+
reply keyboards) or an object with the corresponding properties (`inline <https://core.telegram.org/bots/api#inlinekeyboardbutton>`_
19+
and `reply <https://core.telegram.org/bots/api#keyboardbutton>`_ keyboards)
2420

25-
==========
26-
hide(bool)
27-
==========
21+
.. js:function:: hide([bool])
2822

29-
* ``bool`` <Boolean> *Optional*. Whether or not the keyboard should be hidden. Defaults to true.
23+
:param boolean bool: *Optional*. Whether or not the keyboard should be hidden. Defaults to true.
3024

31-
Setting this to true will make Telegram clients hide the current custom keyboard and display the default letter-keyboard.
25+
Setting this to true will make Telegram clients hide the current custom keyboard and display the default letter-keyboard.
3226

33-
==========
34-
toInline()
35-
==========
27+
.. js:function:: toInline()
3628

37-
Makes this an inline keyboard. It can't be undone.
29+
Makes this an inline keyboard. It can't be undone.

0 commit comments

Comments
 (0)