diff --git a/README.md b/README.md
index 01607d5..a9d5bd6 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,7 @@ TelegramBot
* [new TelegramBot(token, [options])](#new_TelegramBot_new)
* [.stopPolling()](#TelegramBot+stopPolling) ⇒ Promise
* [.getMe()](#TelegramBot+getMe) ⇒ Promise
+ * [.getChat(chatId)](#TelegramBot+getChat) ⇒ Promise
* [.setWebHook(url, [cert])](#TelegramBot+setWebHook)
* [.getUpdates([timeout], [limit], [offset])](#TelegramBot+getUpdates) ⇒ Promise
* [.sendMessage(chatId, text, [options])](#TelegramBot+sendMessage) ⇒ Promise
@@ -80,6 +81,7 @@ TelegramBot
* [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ Promise
* [.getUserProfilePhotos(userId, [offset], [limit])](#TelegramBot+getUserProfilePhotos) ⇒ Promise
* [.sendLocation(chatId, latitude, longitude, [options])](#TelegramBot+sendLocation) ⇒ Promise
+ * [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ Promise
* [.getFile(fileId)](#TelegramBot+getFile) ⇒ Promise
* [.getFileLink(fileId)](#TelegramBot+getFileLink) ⇒ Promise
* [.downloadFile(fileId, downloadDir)](#TelegramBot+downloadFile) ⇒ Promise
@@ -119,6 +121,20 @@ Returns basic information about the bot in form of a `User` object.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**See**: https://core.telegram.org/bots/api#getme
+
+
+### telegramBot.getChat(chatId) ⇒ Promise
+Use this method to get up to date information about the chat
+(current name of the user for one-on-one conversations, current
+username of a user, group or channel, etc.).
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**See**: https://core.telegram.org/bots/api#getchat
+
+| Param | Type | Description |
+| --- | --- | --- |
+| chatId | Number
| String
| Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
+
### telegramBot.setWebHook(url, [cert])
@@ -426,6 +442,24 @@ Use this method to send point on the map.
| longitude | Float
| Longitude of location |
| [options] | Object
| Additional Telegram query options |
+
+
+### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ Promise
+Send venue.
+Use this method to send information about a venue.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**See**: https://core.telegram.org/bots/api#sendvenue
+
+| Param | Type | Description |
+| --- | --- | --- |
+| chatId | Number
| String
| Unique identifier for the message recipient |
+| latitude | Float
| Latitude of location |
+| longitude | Float
| Longitude of location |
+| title | String
| Name of the venue |
+| address | String
| Address of the venue |
+| [options] | Object
| Additional Telegram query options |
+
### telegramBot.getFile(fileId) ⇒ Promise
diff --git a/src/telegram.js b/src/telegram.js
index cde1858..49eaacb 100644
--- a/src/telegram.js
+++ b/src/telegram.js
@@ -140,7 +140,7 @@ class TelegramBot extends EventEmitter {
throw new Error(`Error parsing Telegram response: ${String(json)}`);
}
}
-
+
_fixReplyMarkup(obj) {
const replyMarkup = obj.reply_markup;
if (replyMarkup && typeof replyMarkup !== 'string') {
@@ -205,6 +205,21 @@ class TelegramBot extends EventEmitter {
return this._request(_path);
}
+ /**
+ * Use this method to get up to date information about the chat
+ * (current name of the user for one-on-one conversations, current
+ * username of a user, group or channel, etc.).
+ * @param {Number|String} chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+ * @return {Promise}
+ * @see https://core.telegram.org/bots/api#getchat
+ */
+ getChat(chatId) {
+ const form = {
+ chat_id: chatId
+ };
+ return this._request('getChat', { form });
+ }
+
/**
* Specify an url to receive incoming updates via an outgoing webHook.
* @param {String} url URL where Telegram will make HTTP Post. Leave empty to
@@ -633,7 +648,7 @@ class TelegramBot extends EventEmitter {
form.longitude = longitude;
return this._request('sendLocation', { form });
}
-
+
/**
* Send venue.
* Use this method to send information about a venue.
diff --git a/test/index.js b/test/index.js
index 207a015..cf4b0a4 100644
--- a/test/index.js
+++ b/test/index.js
@@ -131,6 +131,15 @@ describe('Telegram', function telegramSuite() {
});
});
+ describe('#getChat', function getChatSuite() {
+ it('should return a Chat object', function test() {
+ const bot = new Telegram(TOKEN);
+ return bot.getChat(USERID).then(resp => {
+ assert.ok(is.object(resp));
+ });
+ });
+ });
+
describe('#getUpdates', function getUpdatesSuite() {
it('should return an Array', function test() {
const bot = new Telegram(TOKEN);