n8n/packages/nodes-base/credentials/TelegramApi.credentials.ts
Daniil Zobov 87f965e905
feat(Telegram Node): Add support for local bot api server (#8437)
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
2024-05-20 13:47:01 +01:00

36 lines
847 B
TypeScript

import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
export class TelegramApi implements ICredentialType {
name = 'telegramApi';
displayName = 'Telegram API';
documentationUrl = 'telegram';
properties: INodeProperties[] = [
{
displayName: 'Access Token',
name: 'accessToken',
type: 'string',
typeOptions: { password: true },
default: '',
description:
'Chat with the <a href="https://telegram.me/botfather">bot father</a> to obtain the access token',
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'https://api.telegram.org',
description: 'Base URL for Telegram Bot API',
},
];
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.baseUrl}}/bot{{$credentials.accessToken}}',
url: '/getMe',
},
};
}