From 9d25ceb3c47c71c17e3290d570c24d7cdeea0157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20J=C3=A4ppinen?= Date: Fri, 6 May 2016 21:03:04 +0300 Subject: [PATCH] add the sendVenue method This method was added to the Telegram Bot API on April 9, 2016 in the Bot API 2.0 update. See https://core.telegram.org/bots/api#sendvenue for more info. --- src/telegram.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/telegram.js b/src/telegram.js index c58447d..79b61d6 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -490,6 +490,28 @@ class TelegramBot extends EventEmitter { form.longitude = longitude; return this._request('sendLocation', { form }); } + + /** + * Send venue. + * Use this method to send information about a venue. + * + * @param {Number|String} chatId Unique identifier for the message recipient + * @param {Float} latitude Latitude of location + * @param {Float} longitude Longitude of location + * @param {String} title Name of the venue + * @param {String} address Address of the venue + * @param {Object} [options] Additional Telegram query options + * @return {Promise} + * @see https://core.telegram.org/bots/api#sendvenue + */ + sendVenue(chatId, latitude, longitude, title, address, form = {}) { + form.chat_id = chatId; + form.latitude = latitude; + form.longitude = longitude; + form.title = title; + form.address = address; + return this._request('sendVenue', { form }); + } /** * Get file.