mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Add "Sent by n8n" attribution (#7183)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ export class Telegram implements INodeType {
|
||||
name: 'telegram',
|
||||
icon: 'file:telegram.svg',
|
||||
group: ['output'],
|
||||
version: 1,
|
||||
version: [1, 1.1],
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Sends data to Telegram',
|
||||
defaults: {
|
||||
@@ -1461,6 +1461,20 @@ export class Telegram implements INodeType {
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
displayName: 'Append n8n Attribution',
|
||||
name: 'appendAttribution',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description:
|
||||
'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/operation': ['sendMessage'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Caption',
|
||||
name: 'caption',
|
||||
@@ -1693,6 +1707,9 @@ export class Telegram implements INodeType {
|
||||
const resource = this.getNodeParameter('resource', 0);
|
||||
const binaryData = this.getNodeParameter('binaryData', 0, false);
|
||||
|
||||
const nodeVersion = this.getNode().typeVersion;
|
||||
const instanceId = await this.getInstanceId();
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
// Reset all values
|
||||
@@ -1917,7 +1934,7 @@ export class Telegram implements INodeType {
|
||||
body.text = this.getNodeParameter('text', i) as string;
|
||||
|
||||
// Add additional fields and replyMarkup
|
||||
addAdditionalFields.call(this, body, i);
|
||||
addAdditionalFields.call(this, body, i, nodeVersion, instanceId);
|
||||
} else if (operation === 'sendMediaGroup') {
|
||||
// ----------------------------------
|
||||
// message:sendMediaGroup
|
||||
|
||||
Reference in New Issue
Block a user