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

Commit 33d92d0

Browse files
committed
More documentation for the Chat object
1 parent a4f3e5a commit 33d92d0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/objects/Chat.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Chat
33

44
This object represents a Telegram chat.
55

6+
.. note::
7+
8+
This object inherits some properties from the corresponding `Telegram object<https://core.telegram.org/bots/api#chat>`_
9+
610
=================
711
Chat(object, bot)
812
=================
@@ -131,4 +135,10 @@ sendAction(action)
131135

132136
* ``action`` <String> Must be one of the following: ``typing``, ``upload_photo``, ``record_video``, ``upload_video``, ``record_audio``, ``upload_audio``, ``upload_document``, ``find_location``
133137

134-
Returns a promise that resolves to the response (true on success).
138+
Returns a promise that resolves to the response (true on success).
139+
140+
====
141+
name
142+
====
143+
144+
<String> *Optional*. The full name of the chat (first name + last name) if available

lib/Chat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Chat(object, bot) {
77
if (object == undefined) return;
88
extend(this, object);
99

10-
this.name = this.first_name + (this.last_name ? " " + this.last_name : "");
10+
if (this.first_name) this.name = this.first_name + (this.last_name ? " " + this.last_name : "");
1111
this.bot = bot;
1212

1313
this.sendMessage = (text, options) => {

0 commit comments

Comments
 (0)