70 lines
2 KiB
JSON
70 lines
2 KiB
JSON
{
|
|
"type": "telegram",
|
|
"version": 1,
|
|
"displayName": "Telegram",
|
|
"description": "Send messages and manage a Telegram bot through the Bot API",
|
|
"kind": "action",
|
|
"categories": ["Communication"],
|
|
"icon": "node:telegram",
|
|
"iconColor": "#2AABEE",
|
|
"inputs": [{ "kind": "main" }],
|
|
"outputs": [
|
|
{ "kind": "main" },
|
|
{ "kind": "error", "label": "error" }
|
|
],
|
|
"runMode": "eachItem",
|
|
"origin": "connector",
|
|
"documentationUrl": "https://core.telegram.org/bots/api",
|
|
"connector": {
|
|
"baseUrl": "https://api.telegram.org",
|
|
"path": "/bot{credential.token}/{operation}",
|
|
"method": "POST",
|
|
"contentType": "json",
|
|
"bodyParameter": "body",
|
|
"credentialAlias": "telegram",
|
|
"responsePath": "result"
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "operation",
|
|
"displayName": "Operation",
|
|
"type": "options",
|
|
"default": "sendMessage",
|
|
"noDataExpression": true,
|
|
"options": [
|
|
{ "name": "Send Message", "value": "sendMessage" },
|
|
{ "name": "Send Photo", "value": "sendPhoto" },
|
|
{ "name": "Edit Message Text", "value": "editMessageText" },
|
|
{ "name": "Get Me", "value": "getMe" }
|
|
]
|
|
},
|
|
{
|
|
"name": "credential",
|
|
"displayName": "Credential",
|
|
"type": "resourceLocator",
|
|
"loadOptionsMethod": "listCredentials",
|
|
"default": ""
|
|
},
|
|
{
|
|
"name": "body",
|
|
"displayName": "Body",
|
|
"type": "json",
|
|
"default": {},
|
|
"description": "JSON parameters for the operation, e.g. { \"chat_id\": 123456789, \"text\": \"hi\" }",
|
|
"visibleWhen": { "hide": { "operation": ["getMe"] } }
|
|
},
|
|
{
|
|
"name": "options",
|
|
"displayName": "Options",
|
|
"type": "collection",
|
|
"fields": [
|
|
{ "name": "neverError", "displayName": "Never error on non-2xx", "type": "boolean", "default": false },
|
|
{ "name": "timeoutMs", "displayName": "Timeout (ms)", "type": "number", "default": 30000 }
|
|
]
|
|
}
|
|
],
|
|
"credentials": [
|
|
{ "alias": "telegram", "displayName": "Telegram bot", "required": true }
|
|
]
|
|
}
|