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

Commit 98ddb99

Browse files
committed
Documentation for the User object
1 parent 33d92d0 commit 98ddb99

File tree

3 files changed

+110
-2
lines changed

3 files changed

+110
-2
lines changed

docs/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ Nodeogram is released under the GNU General Public License 3.0.
7373
:caption: Objects
7474
:glob:
7575

76-
objects/Bot
76+
objects/Bot
77+
objects/Chat
78+
objects/User

docs/objects/Chat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This object represents a Telegram chat.
55

66
.. note::
77

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

1010
=================
1111
Chat(object, bot)

docs/objects/User.rst

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
User
2+
====
3+
4+
This object represents a Telegram user.
5+
6+
.. note::
7+
8+
This object inherits some properties from the corresponding `Telegram object <https://core.telegram.org/bots/api#user>`_
9+
10+
=================
11+
User(object, bot)
12+
=================
13+
14+
.. warning::
15+
16+
This constructor should be for internal use only.
17+
18+
Creates a new User object.
19+
20+
==========================
21+
sendMessage(text, options)
22+
==========================
23+
24+
* ``text`` <String>
25+
* ``options`` <Object> *Optional*
26+
27+
Sends a message to the user and returns a promise that resolves to a :doc:`Message` object representing what has been sent.
28+
29+
==========================================
30+
sendLocation(longitude, latitude, options)
31+
==========================================
32+
33+
* ``longitude`` <Number>
34+
* ``latitude`` <Number>
35+
* ``options`` <Object> *Optional*
36+
37+
Sends a location object to the user and returns a promise that resolves to a :doc:`Message` object representing what has
38+
been sent.
39+
40+
=======================================================
41+
sendVenue(longitude, latitude, title, address, options)
42+
=======================================================
43+
44+
* ``longitude`` <Number>
45+
* ``latitude`` <Number>
46+
* ``title`` <String>
47+
* ``address`` <String>
48+
* ``options`` <Object> *Optional*
49+
50+
Sends a venue object to the user and returns a promise that resolves to a :doc:`Message` object representing what has
51+
been sent.
52+
53+
==============================================
54+
sendContact(phone_number, first_name, options)
55+
==============================================
56+
57+
* ``phone_number`` <String>
58+
* ``first_name`` <String>
59+
* ``options`` <Object> *Optional*
60+
61+
Sends a contact object to the user and returns a promise that resolves to a :doc:`Message` object representing what has
62+
been sent.
63+
64+
=================================================
65+
forwardMessage(from_chat_id, message_id, options)
66+
=================================================
67+
68+
* ``from_chat_id`` <String>
69+
* ``message_id`` <String>
70+
* ``options`` <Object> *Optional*
71+
72+
Forwards a message to the user and returns a promise that resolves to a :doc:`Message` object representing what has
73+
been sent.
74+
75+
=============================
76+
sendFile(type, path, options)
77+
=============================
78+
79+
* ``type`` <String> Must be one of the following: ``photo``, ``audio``, ``sticker``, ``document``, ``video``, ``voice``
80+
* ``path`` <String> File's path for local files or file's id for uploaded files
81+
* ``options`` <Object> *Optional*
82+
83+
Sends the specified file to the user and returns a promise that resolves to a :doc:`Message` object representing
84+
what has been sent.
85+
86+
==================
87+
sendAction(action)
88+
==================
89+
90+
* ``action`` <String> Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
91+
92+
Returns a promise that resolves to the response (true on success).
93+
94+
=========================
95+
getProfilePhotos(options)
96+
=========================
97+
98+
* ``options`` <Object> *Optional*
99+
100+
Returns a promise that resolves to a :doc:`UserProfilePhotos` object.
101+
102+
====
103+
name
104+
====
105+
106+
<String> The full name of the user (first name + last name).

0 commit comments

Comments
 (0)