mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 14:25:57 +00:00
sendlocation with options
This commit is contained in:
@@ -383,15 +383,15 @@ TelegramBot.prototype.sendChatAction = function (chatId, action) {
|
|||||||
* @param {Number|String} chatId Unique identifier for the message recipient
|
* @param {Number|String} chatId Unique identifier for the message recipient
|
||||||
* @param {Float} latitude Latitude of location
|
* @param {Float} latitude Latitude of location
|
||||||
* @param {Float} longitude Longitude of location
|
* @param {Float} longitude Longitude of location
|
||||||
|
* @param {Object} [options] Additional Telegram query options
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
* @see https://core.telegram.org/bots/api#sendlocation
|
* @see https://core.telegram.org/bots/api#sendlocation
|
||||||
*/
|
*/
|
||||||
TelegramBot.prototype.sendLocation = function (chatId, latitude, longitude) {
|
TelegramBot.prototype.sendLocation = function (chatId, latitude, longitude, options) {
|
||||||
var query = {
|
var query = options || {};
|
||||||
chat_id: chatId,
|
query.chat_id = chatId;
|
||||||
latitude: latitude,
|
query.latitude = latitude;
|
||||||
longitude: longitude
|
query.longitude = longitude;
|
||||||
};
|
|
||||||
return this._request('sendLocation', {qs: query});
|
return this._request('sendLocation', {qs: query});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user