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

Commit a4f3e5a

Browse files
committed
Documentation for the Chat object
1 parent eb2c799 commit a4f3e5a

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

docs/objects/Chat.rst

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
Chat
2+
====
3+
4+
This object represents a Telegram chat.
5+
6+
=================
7+
Chat(object, bot)
8+
=================
9+
10+
.. warning::
11+
12+
This constructor should be for internal use only.
13+
14+
Creates a new Chat object.
15+
16+
=======
17+
leave()
18+
=======
19+
20+
Leaves the chat and returns a promise that resolves to the response (according to Telegram, true on success).
21+
22+
==========================
23+
sendMessage(text, options)
24+
==========================
25+
26+
* ``text`` <String>
27+
* ``options`` <Object> *Optional*
28+
29+
Sends a message to the chat and returns a promise that resolves to a :doc:`Message` object representing what has been sent.
30+
31+
==========================================
32+
sendLocation(longitude, latitude, options)
33+
==========================================
34+
35+
* ``longitude`` <Number>
36+
* ``latitude`` <Number>
37+
* ``options`` <Object> *Optional*
38+
39+
Sends a location object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
40+
been sent.
41+
42+
=======================================================
43+
sendVenue(longitude, latitude, title, address, options)
44+
=======================================================
45+
46+
* ``longitude`` <Number>
47+
* ``latitude`` <Number>
48+
* ``title`` <String>
49+
* ``address`` <String>
50+
* ``options`` <Object> *Optional*
51+
52+
Sends a venue object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
53+
been sent.
54+
55+
==============================================
56+
sendContact(phone_number, first_name, options)
57+
==============================================
58+
59+
* ``phone_number`` <String>
60+
* ``first_name`` <String>
61+
* ``options`` <Object> *Optional*
62+
63+
Sends a contact object to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
64+
been sent.
65+
66+
=================================================
67+
forwardMessage(from_chat_id, message_id, options)
68+
=================================================
69+
70+
* ``from_chat_id`` <String>
71+
* ``message_id`` <String>
72+
* ``options`` <Object> *Optional*
73+
74+
Forwards a message to the chat and returns a promise that resolves to a :doc:`Message` object representing what has
75+
been sent.
76+
77+
=============================
78+
sendFile(type, path, options)
79+
=============================
80+
81+
* ``type`` <String> Must be one of the following: ``photo``, ``audio``, ``sticker``, ``document``, ``video``, ``voice``
82+
* ``path`` <String> File's path for local files or file's id for uploaded files
83+
* ``options`` <Object> *Optional*
84+
85+
Sends the specified file to the chat and returns a promise that resolves to a :doc:`Message` object representing
86+
what has been sent.
87+
88+
===================
89+
getAdministrators()
90+
===================
91+
92+
* ``chat_id`` <String>|<Chat>
93+
94+
Returns a promise that resolves to an array of :doc:`ChatMember` objects.
95+
96+
==================
97+
getMember(user_id)
98+
==================
99+
100+
* ``user_id`` <String>|<User>
101+
102+
Returns a promise that resolves to a :doc:`ChatMember` object.
103+
104+
===================
105+
kickMember(user_id)
106+
===================
107+
108+
* ``user_id`` <String>|<User>
109+
110+
Kicks the specified user from the chat and returns a promise that resolves to the response (according to
111+
Telegram, true on success).
112+
113+
====================
114+
unbanMember(user_id)
115+
====================
116+
117+
* ``user_id`` <String>|<User>
118+
119+
Unbans the specified user from the chat and returns a promise that resolves to the response (according to
120+
Telegram, true on success).
121+
122+
=================
123+
getMembersCount()
124+
=================
125+
126+
Returns a promise that resolves to the response.
127+
128+
==================
129+
sendAction(action)
130+
==================
131+
132+
* ``action`` <String> Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
133+
134+
Returns a promise that resolves to the response (true on success).

0 commit comments

Comments
 (0)