Add extra larga size option to Telegram (#2827)

This commit is contained in:
Ricardo Espinoza 2022-02-18 10:09:44 -05:00 committed by GitHub
parent 0a9ce092fc
commit c026642f7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -10,7 +10,9 @@ import {
} from 'request';
import {
IBinaryData, IDataObject, NodeApiError, NodeOperationError,
IDataObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
// Interface in n8n
@ -185,6 +187,7 @@ export function getImageBySize(photos: IDataObject[], size: string): IDataObject
'small': 0,
'medium': 1,
'large': 2,
'extraLarge': 3,
} as IDataObject;
const index = sizes[size] as number;

View file

@ -121,7 +121,7 @@ export class TelegramTrigger implements INodeType {
name: 'download',
type: 'boolean',
default: false,
description: `Telegram delivers the image in 3 sizes. By default, just the larger image would be downloaded. If you want to change the size, set the field 'Image Size'.`,
description: `Telegram delivers the image in multiple sizes. By default, just the large image would be downloaded. If you want to change the size, set the field 'Image Size'.`,
},
{
displayName: 'Image Size',
@ -147,6 +147,10 @@ export class TelegramTrigger implements INodeType {
name: 'Large',
value: 'large',
},
{
name: 'Extra Large',
value: 'extraLarge',
},
],
default: 'large',
description: 'The size of the image to be downloaded',