mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 13:14:07 -08:00
87f965e905
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
36 lines
847 B
TypeScript
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',
|
|
},
|
|
};
|
|
}
|