mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
✨ Add send location functionality to Telegram Node
This commit is contained in:
parent
bbf2baf58e
commit
c26d0ae407
|
@ -230,6 +230,11 @@ export class Telegram implements INodeType {
|
||||||
value: 'sendDocument',
|
value: 'sendDocument',
|
||||||
description: 'Send a document',
|
description: 'Send a document',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Send Location',
|
||||||
|
value: 'sendLocation',
|
||||||
|
description: 'Send a location'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Send Message',
|
name: 'Send Message',
|
||||||
value: 'sendMessage',
|
value: 'sendMessage',
|
||||||
|
@ -284,6 +289,7 @@ export class Telegram implements INodeType {
|
||||||
'sendAudio',
|
'sendAudio',
|
||||||
'sendChatAction',
|
'sendChatAction',
|
||||||
'sendDocument',
|
'sendDocument',
|
||||||
|
'sendLocation',
|
||||||
'sendMessage',
|
'sendMessage',
|
||||||
'sendMediaGroup',
|
'sendMediaGroup',
|
||||||
'sendPhoto',
|
'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
|
// 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',
|
'sendSticker',
|
||||||
'sendVideo',
|
'sendVideo',
|
||||||
'sendAudio',
|
'sendAudio',
|
||||||
|
'sendLocation'
|
||||||
],
|
],
|
||||||
resource: [
|
resource: [
|
||||||
'message',
|
'message',
|
||||||
|
@ -1340,6 +1396,7 @@ export class Telegram implements INodeType {
|
||||||
'sendAnimation',
|
'sendAnimation',
|
||||||
'sendAudio',
|
'sendAudio',
|
||||||
'sendDocument',
|
'sendDocument',
|
||||||
|
'sendLocation',
|
||||||
'sendMessage',
|
'sendMessage',
|
||||||
'sendMediaGroup',
|
'sendMediaGroup',
|
||||||
'sendPhoto',
|
'sendPhoto',
|
||||||
|
@ -1757,6 +1814,20 @@ export class Telegram implements INodeType {
|
||||||
// Add additional fields and replyMarkup
|
// Add additional fields and replyMarkup
|
||||||
addAdditionalFields.call(this, body, i);
|
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') {
|
} else if (operation === 'sendMessage') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// message:sendMessage
|
// message:sendMessage
|
||||||
|
|
Loading…
Reference in a new issue