🔀 Merge branch 'maxdanilov-telegram-send-location'

This commit is contained in:
Jan Oberhauser 2021-02-21 21:52:05 +01:00
commit a94703804f

View file

@ -230,6 +230,11 @@ export class Telegram implements INodeType {
value: 'sendDocument',
description: 'Send a document',
},
{
name: 'Send Location',
value: 'sendLocation',
description: 'Send a location',
},
{
name: 'Send Message',
value: 'sendMessage',
@ -284,6 +289,7 @@ export class Telegram implements INodeType {
'sendAudio',
'sendChatAction',
'sendDocument',
'sendLocation',
'sendMessage',
'sendMediaGroup',
'sendPhoto',
@ -811,6 +817,55 @@ export class Telegram implements INodeType {
},
// ----------------------------------
// message:sendLocation
// ----------------------------------
{
displayName: 'Latitude',
name: 'latitude',
type: 'number',
default: 0.0,
typeOptions: {
numberPrecision: 10,
minValue: -90,
maxValue: 90,
},
displayOptions: {
show: {
operation: [
'sendLocation',
],
resource: [
'message',
],
},
},
description: 'Location latitude',
},
{
displayName: 'Longitude',
name: 'longitude',
type: 'number',
typeOptions: {
numberPrecision: 10,
minValue: -180,
maxValue: 180,
},
default: 0.0,
displayOptions: {
show: {
operation: [
'sendLocation',
],
resource: [
'message',
],
},
},
description: 'Location longitude',
},
// ----------------------------------
// message:sendMediaGroup
// ----------------------------------
@ -999,7 +1054,7 @@ export class Telegram implements INodeType {
// ----------------------------------
// message:editMessageText/sendAnimation/sendAudio/sendMessage/sendPhoto/sendSticker/sendVideo
// message:editMessageText/sendAnimation/sendAudio/sendLocation/sendMessage/sendPhoto/sendSticker/sendVideo
// ----------------------------------
{
@ -1015,6 +1070,7 @@ export class Telegram implements INodeType {
'sendSticker',
'sendVideo',
'sendAudio',
'sendLocation',
],
resource: [
'message',
@ -1340,6 +1396,7 @@ export class Telegram implements INodeType {
'sendAnimation',
'sendAudio',
'sendDocument',
'sendLocation',
'sendMessage',
'sendMediaGroup',
'sendPhoto',
@ -1757,6 +1814,20 @@ export class Telegram implements INodeType {
// Add additional fields and replyMarkup
addAdditionalFields.call(this, body, i);
} else if (operation === 'sendLocation') {
// ----------------------------------
// message:sendLocation
// ----------------------------------
endpoint = 'sendLocation';
body.chat_id = this.getNodeParameter('chatId', i) as string;
body.latitude = this.getNodeParameter('latitude', i) as string;
body.longitude = this.getNodeParameter('longitude', i) as string;
// Add additional fields and replyMarkup
addAdditionalFields.call(this, body, i);
} else if (operation === 'sendMessage') {
// ----------------------------------
// message:sendMessage