🐛 Fix bug when sending audio with Telegram

🐛 fix bug when sending audio
This commit is contained in:
Jan 2021-01-07 13:33:34 +01:00 committed by GitHub
commit b389ef116d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,10 @@ export class Telegram implements INodeType {
name: 'resource',
type: 'options',
options: [
// {
// name: 'Bot',
// value: 'bot',
// },
{
name: 'Chat',
value: 'chat',
@ -63,7 +67,31 @@ export class Telegram implements INodeType {
description: 'The resource to operate on.',
},
// ----------------------------------
// operation
// ----------------------------------
// {
// displayName: 'Operation',
// name: 'operation',
// type: 'options',
// displayOptions: {
// show: {
// resource: [
// 'bot',
// ],
// },
// },
// options: [
// {
// name: 'Info',
// value: 'info',
// description: 'Get information about the bot associated with the access token.',
// },
// ],
// default: 'info',
// description: 'The operation to perform.',
// },
// ----------------------------------
// operation
@ -926,6 +954,7 @@ export class Telegram implements INodeType {
'sendPhoto',
'sendSticker',
'sendVideo',
'sendAudio',
],
resource: [
'message',
@ -1554,7 +1583,10 @@ export class Telegram implements INodeType {
body.title = this.getNodeParameter('title', i) as string;
}
// } else if (resource === 'bot') {
// if (operation === 'info') {
// endpoint = 'getUpdates';
// }
} else if (resource === 'file') {
if (operation === 'get') {
@ -1746,6 +1778,13 @@ export class Telegram implements INodeType {
}
}
// if (resource === 'bot' && operation === 'info') {
// responseData = {
// user: responseData.result[0].message.from,
// chat: responseData.result[0].message.chat,
// };
// }
returnData.push({ json: responseData });
}