@catalogicus-international/n8n-nodes-telegram-advance 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +100 -0
- package/dist/credentials/TelegramAdvanceApi.credentials.d.ts +10 -0
- package/dist/credentials/TelegramAdvanceApi.credentials.js +43 -0
- package/dist/credentials/TelegramAdvanceApi.credentials.js.map +1 -0
- package/dist/credentials/TelegramAdvanceStoreApi.credentials.d.ts +8 -0
- package/dist/credentials/TelegramAdvanceStoreApi.credentials.js +40 -0
- package/dist/credentials/TelegramAdvanceStoreApi.credentials.js.map +1 -0
- package/dist/icons/telegram.svg +4 -0
- package/dist/nodes/TelegramAdvance/TelegramAdvance.node.d.ts +11 -0
- package/dist/nodes/TelegramAdvance/TelegramAdvance.node.js +343 -0
- package/dist/nodes/TelegramAdvance/TelegramAdvance.node.js.map +1 -0
- package/dist/nodes/TelegramAdvance/TelegramAdvance.node.json +22 -0
- package/dist/nodes/TelegramAdvanceSend/TelegramAdvanceSend.node.d.ts +5 -0
- package/dist/nodes/TelegramAdvanceSend/TelegramAdvanceSend.node.js +139 -0
- package/dist/nodes/TelegramAdvanceSend/TelegramAdvanceSend.node.js.map +1 -0
- package/dist/nodes/TelegramAdvanceSend/TelegramAdvanceSend.node.json +19 -0
- package/dist/nodes/TelegramAdvanceTrigger/TelegramAdvanceTrigger.node.d.ts +17 -0
- package/dist/nodes/TelegramAdvanceTrigger/TelegramAdvanceTrigger.node.js +273 -0
- package/dist/nodes/TelegramAdvanceTrigger/TelegramAdvanceTrigger.node.js.map +1 -0
- package/dist/nodes/TelegramAdvanceTrigger/TelegramAdvanceTrigger.node.json +22 -0
- package/dist/nodes/pendingStore.d.ts +26 -0
- package/dist/nodes/pendingStore.js +25 -0
- package/dist/nodes/pendingStore.js.map +1 -0
- package/dist/nodes/question.d.ts +19 -0
- package/dist/nodes/question.js +70 -0
- package/dist/nodes/question.js.map +1 -0
- package/dist/nodes/redisPendingStore.d.ts +25 -0
- package/dist/nodes/redisPendingStore.js +165 -0
- package/dist/nodes/redisPendingStore.js.map +1 -0
- package/dist/nodes/shared.d.ts +37 -0
- package/dist/nodes/shared.js +36 -0
- package/dist/nodes/shared.js.map +1 -0
- package/dist/nodes/wait.d.ts +2 -0
- package/dist/nodes/wait.js +15 -0
- package/dist/nodes/wait.js.map +1 -0
- package/package.json +63 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Catalogicus International
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# @catalogicus-international/n8n-nodes-telegram-advance
|
|
2
|
+
|
|
3
|
+
An n8n community package for Telegram-native human-in-the-loop workflows.
|
|
4
|
+
It sends a question and pauses the current execution until the user responds
|
|
5
|
+
inside Telegram. No n8n approval page or external response form is opened.
|
|
6
|
+
|
|
7
|
+
## Nodes
|
|
8
|
+
|
|
9
|
+
### Telegram Advance
|
|
10
|
+
|
|
11
|
+
Use this node in the workflow branch that needs a human response. It supports:
|
|
12
|
+
|
|
13
|
+
- **Approval** — approve and decline inline buttons;
|
|
14
|
+
- **Choice** — custom inline buttons, for example a product or delivery option;
|
|
15
|
+
- **Free Text** — the user replies directly to the bot message.
|
|
16
|
+
|
|
17
|
+
The node resumes with data shaped like:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"response": {
|
|
22
|
+
"type": "choice",
|
|
23
|
+
"value": "sku-123",
|
|
24
|
+
"label": "Product A",
|
|
25
|
+
"user": {
|
|
26
|
+
"id": 123456789,
|
|
27
|
+
"username": "example"
|
|
28
|
+
},
|
|
29
|
+
"chat": {
|
|
30
|
+
"id": 123456789
|
|
31
|
+
},
|
|
32
|
+
"questionMessageId": 42,
|
|
33
|
+
"receivedAt": "2026-06-21T12:00:00.000Z"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Approval responses also contain `approved: true` or `approved: false`.
|
|
39
|
+
Free-text responses contain `text` and return the same value in `value`.
|
|
40
|
+
|
|
41
|
+
### Telegram Advance Trigger
|
|
42
|
+
|
|
43
|
+
Add exactly one trigger for the bot to the **same workflow** as the waiting
|
|
44
|
+
Telegram Advance nodes, then activate the workflow. The trigger owns the
|
|
45
|
+
Telegram webhook and routes button clicks or message replies to the correct
|
|
46
|
+
waiting execution.
|
|
47
|
+
|
|
48
|
+
The trigger emits a small internal event with `telegramAdvanceRouted: true`
|
|
49
|
+
after a response is routed. Leaving the trigger disconnected is the simplest
|
|
50
|
+
setup. If you connect it to other nodes, filter out routed events unless you
|
|
51
|
+
intentionally want to process them.
|
|
52
|
+
|
|
53
|
+
The trigger can also emit Telegram messages and callbacks that do not belong
|
|
54
|
+
to a waiting question. Disable **Emit Unmatched Updates** if the workflow only
|
|
55
|
+
uses the trigger as an internal response router.
|
|
56
|
+
|
|
57
|
+
## Setup
|
|
58
|
+
|
|
59
|
+
1. Create a bot with [BotFather](https://t.me/BotFather) and copy its token.
|
|
60
|
+
2. Create `Telegram Advance API` credentials in n8n.
|
|
61
|
+
3. Create an Upstash-compatible Redis REST database and add its HTTPS URL and
|
|
62
|
+
token as `Telegram Advance Store API` credentials.
|
|
63
|
+
4. Add `Telegram Advance Trigger` to the workflow and select both credentials.
|
|
64
|
+
5. Add `Telegram Advance` where the workflow must pause for a response, using
|
|
65
|
+
the same store credentials.
|
|
66
|
+
6. Activate the workflow.
|
|
67
|
+
|
|
68
|
+
Telegram permits only one webhook per bot. Do not use the same bot with another
|
|
69
|
+
Telegram Trigger in a different active workflow.
|
|
70
|
+
|
|
71
|
+
For free-text questions, the user must reply to the bot's question message.
|
|
72
|
+
This lets the trigger distinguish several concurrent pending questions in the
|
|
73
|
+
same chat.
|
|
74
|
+
|
|
75
|
+
## Reliability notes
|
|
76
|
+
|
|
77
|
+
Pending response routes are stored in Redis rather than workflow static data,
|
|
78
|
+
so the trigger can route responses across n8n workers and after process
|
|
79
|
+
restarts. Responses are claimed atomically before an execution is resumed,
|
|
80
|
+
which makes duplicate Telegram webhook deliveries harmless.
|
|
81
|
+
|
|
82
|
+
When a wait timeout is configured, Redis removes its route at the same time.
|
|
83
|
+
Routes without a timeout remain until the user responds.
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm install
|
|
89
|
+
pnpm run lint
|
|
90
|
+
pnpm test
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Resources
|
|
94
|
+
|
|
95
|
+
- [Telegram Bot API](https://core.telegram.org/bots/api)
|
|
96
|
+
- [n8n community node documentation](https://docs.n8n.io/integrations/creating-nodes/)
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
[MIT](LICENSE.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TelegramAdvanceApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelegramAdvanceApi = void 0;
|
|
4
|
+
class TelegramAdvanceApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'telegramAdvanceApi';
|
|
7
|
+
this.displayName = 'Telegram Advance API';
|
|
8
|
+
this.icon = 'file:../icons/telegram.svg';
|
|
9
|
+
this.documentationUrl = 'https://core.telegram.org/bots/features#creating-a-new-bot';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Bot Access Token',
|
|
13
|
+
name: 'accessToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Token provided by BotFather',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Base URL',
|
|
22
|
+
name: 'baseUrl',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: 'https://api.telegram.org',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'Telegram Bot API base URL, or the URL of a local Bot API server',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: {},
|
|
32
|
+
};
|
|
33
|
+
this.test = {
|
|
34
|
+
request: {
|
|
35
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
36
|
+
url: '={{"/bot" + $credentials.accessToken + "/getMe"}}',
|
|
37
|
+
method: 'GET',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.TelegramAdvanceApi = TelegramAdvanceApi;
|
|
43
|
+
//# sourceMappingURL=TelegramAdvanceApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelegramAdvanceApi.credentials.js","sourceRoot":"","sources":["../../credentials/TelegramAdvanceApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAE5B,gBAAW,GAAG,sBAAsB,CAAC;QAErC,SAAI,GAAS,4BAA4B,CAAC;QAE1C,qBAAgB,GAAG,4DAA4D,CAAC;QAEhF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,6BAA6B;aAC1C;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,iEAAiE;aAC9E;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,mDAAmD;gBACxD,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAzCD,gDAyCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TelegramAdvanceStoreApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelegramAdvanceStoreApi = void 0;
|
|
4
|
+
class TelegramAdvanceStoreApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'telegramAdvanceStoreApi';
|
|
7
|
+
this.displayName = 'Telegram Advance Store API';
|
|
8
|
+
this.icon = 'file:../icons/telegram.svg';
|
|
9
|
+
this.documentationUrl = 'https://redis.io/docs/latest/develop/clients/';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Redis REST URL',
|
|
13
|
+
name: 'redisRestUrl',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Upstash-compatible Redis REST URL. Use the same database for the waiting node and trigger.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Redis REST Token',
|
|
21
|
+
name: 'redisRestToken',
|
|
22
|
+
type: 'string',
|
|
23
|
+
typeOptions: { password: true },
|
|
24
|
+
default: '',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'Bearer token for the Redis REST API',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Key Prefix',
|
|
30
|
+
name: 'keyPrefix',
|
|
31
|
+
type: 'string',
|
|
32
|
+
default: 'telegram-advance',
|
|
33
|
+
required: true,
|
|
34
|
+
description: 'Prefix used to isolate Telegram Advance routes in Redis',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.TelegramAdvanceStoreApi = TelegramAdvanceStoreApi;
|
|
40
|
+
//# sourceMappingURL=TelegramAdvanceStoreApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelegramAdvanceStoreApi.credentials.js","sourceRoot":"","sources":["../../credentials/TelegramAdvanceStoreApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,uBAAuB;IAApC;QACC,SAAI,GAAG,yBAAyB,CAAC;QAEjC,gBAAW,GAAG,4BAA4B,CAAC;QAE3C,SAAI,GAAS,4BAA4B,CAAC;QAE1C,qBAAgB,GAAG,+CAA+C,CAAC;QAEnE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,4FAA4F;aAC7F;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kBAAkB;gBAC3B,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,yDAAyD;aACtE;SACD,CAAC;IACH,CAAC;CAAA;AArCD,0DAqCC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<circle cx="12" cy="12" r="12" fill="#229ED9"/>
|
|
3
|
+
<path fill="#fff" d="M18.9 6.2 16.5 18c-.2.8-.7 1-1.4.6l-3.7-2.7-1.8 1.7c-.2.2-.4.4-.8.4l.3-3.8 6.9-6.3c.3-.3-.1-.4-.5-.2L7 13l-3.7-1.2c-.8-.3-.8-.8.2-1.2l14.4-5.5c.7-.2 1.3.2 1 .9Z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class TelegramAdvance implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
credentialTest: {
|
|
6
|
+
telegramAdvanceStoreApiTest: import("n8n-workflow").ICredentialTestFunction;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelegramAdvance = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const question_1 = require("../question");
|
|
7
|
+
const redisPendingStore_1 = require("../redisPendingStore");
|
|
8
|
+
const shared_1 = require("../shared");
|
|
9
|
+
const wait_1 = require("../wait");
|
|
10
|
+
class TelegramAdvance {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.description = {
|
|
13
|
+
displayName: 'Telegram Advance',
|
|
14
|
+
name: 'telegramAdvance',
|
|
15
|
+
icon: 'file:../../icons/telegram.svg',
|
|
16
|
+
group: ['output'],
|
|
17
|
+
version: 1,
|
|
18
|
+
subtitle: '={{$parameter["responseType"]}}',
|
|
19
|
+
description: 'Ask a question in Telegram and wait for an in-chat response',
|
|
20
|
+
defaults: {
|
|
21
|
+
name: 'Telegram Advance',
|
|
22
|
+
},
|
|
23
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
24
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
25
|
+
credentials: [
|
|
26
|
+
{
|
|
27
|
+
name: 'telegramAdvanceApi',
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'telegramAdvanceStoreApi',
|
|
32
|
+
required: true,
|
|
33
|
+
testedBy: 'telegramAdvanceStoreApiTest',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
waitingNodeTooltip: "Execution will continue after the user's Telegram response",
|
|
37
|
+
webhooks: [
|
|
38
|
+
{
|
|
39
|
+
name: 'default',
|
|
40
|
+
httpMethod: 'POST',
|
|
41
|
+
responseMode: 'onReceived',
|
|
42
|
+
responseData: '',
|
|
43
|
+
path: '={{ $nodeId }}',
|
|
44
|
+
restartWebhook: true,
|
|
45
|
+
isFullPath: true,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
properties: [
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Telegram Advance Trigger Required',
|
|
51
|
+
name: 'triggerNotice',
|
|
52
|
+
type: 'notice',
|
|
53
|
+
default: '',
|
|
54
|
+
description: 'Add and activate Telegram Advance Trigger in this same workflow. It receives button clicks and message replies for all waiting executions.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Chat ID',
|
|
58
|
+
name: 'chatId',
|
|
59
|
+
type: 'string',
|
|
60
|
+
default: '={{ $json.message?.chat?.id || $json.chatId }}',
|
|
61
|
+
required: true,
|
|
62
|
+
description: 'Target Telegram chat ID',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Question',
|
|
66
|
+
name: 'question',
|
|
67
|
+
type: 'string',
|
|
68
|
+
typeOptions: { rows: 4 },
|
|
69
|
+
default: '',
|
|
70
|
+
required: true,
|
|
71
|
+
description: 'Message shown to the Telegram user',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Response Type',
|
|
75
|
+
name: 'responseType',
|
|
76
|
+
type: 'options',
|
|
77
|
+
noDataExpression: true,
|
|
78
|
+
options: [
|
|
79
|
+
{
|
|
80
|
+
name: 'Approval',
|
|
81
|
+
value: 'approval',
|
|
82
|
+
description: 'Show approve and decline buttons',
|
|
83
|
+
action: 'Wait for approval',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Choice',
|
|
87
|
+
value: 'choice',
|
|
88
|
+
description: 'Show one or more custom choices, such as products',
|
|
89
|
+
action: 'Wait for a choice',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Free Text',
|
|
93
|
+
value: 'text',
|
|
94
|
+
description: 'Ask the user to reply to the Telegram message',
|
|
95
|
+
action: 'Wait for a text reply',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
default: 'approval',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Approve Label',
|
|
102
|
+
name: 'approveLabel',
|
|
103
|
+
type: 'string',
|
|
104
|
+
default: '✅ Approve',
|
|
105
|
+
displayOptions: { show: { responseType: ['approval'] } },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
displayName: 'Approve Value',
|
|
109
|
+
name: 'approveValue',
|
|
110
|
+
type: 'string',
|
|
111
|
+
default: 'approved',
|
|
112
|
+
displayOptions: { show: { responseType: ['approval'] } },
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
displayName: 'Decline Label',
|
|
116
|
+
name: 'declineLabel',
|
|
117
|
+
type: 'string',
|
|
118
|
+
default: '❌ Decline',
|
|
119
|
+
displayOptions: { show: { responseType: ['approval'] } },
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
displayName: 'Decline Value',
|
|
123
|
+
name: 'declineValue',
|
|
124
|
+
type: 'string',
|
|
125
|
+
default: 'declined',
|
|
126
|
+
displayOptions: { show: { responseType: ['approval'] } },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Choices',
|
|
130
|
+
name: 'choices',
|
|
131
|
+
type: 'fixedCollection',
|
|
132
|
+
typeOptions: { multipleValues: true },
|
|
133
|
+
placeholder: 'Add Choice',
|
|
134
|
+
default: {},
|
|
135
|
+
displayOptions: { show: { responseType: ['choice'] } },
|
|
136
|
+
options: [
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Choice',
|
|
139
|
+
name: 'choice',
|
|
140
|
+
values: [
|
|
141
|
+
{
|
|
142
|
+
displayName: 'Label',
|
|
143
|
+
name: 'label',
|
|
144
|
+
type: 'string',
|
|
145
|
+
default: '',
|
|
146
|
+
required: true,
|
|
147
|
+
description: 'Text shown on the Telegram button',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Value',
|
|
151
|
+
name: 'value',
|
|
152
|
+
type: 'string',
|
|
153
|
+
default: '',
|
|
154
|
+
required: true,
|
|
155
|
+
description: 'Value returned to the workflow',
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Buttons Per Row',
|
|
163
|
+
name: 'buttonsPerRow',
|
|
164
|
+
type: 'number',
|
|
165
|
+
typeOptions: { minValue: 1, maxValue: 8 },
|
|
166
|
+
default: 1,
|
|
167
|
+
displayOptions: { show: { responseType: ['approval', 'choice'] } },
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
displayName: 'Reply Placeholder',
|
|
171
|
+
name: 'inputPlaceholder',
|
|
172
|
+
type: 'string',
|
|
173
|
+
default: 'Type your answer…',
|
|
174
|
+
displayOptions: { show: { responseType: ['text'] } },
|
|
175
|
+
description: 'Placeholder shown in the Telegram reply field',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
displayName: 'Options',
|
|
179
|
+
name: 'options',
|
|
180
|
+
type: 'collection',
|
|
181
|
+
placeholder: 'Add Option',
|
|
182
|
+
default: {},
|
|
183
|
+
options: [
|
|
184
|
+
{
|
|
185
|
+
displayName: 'Acknowledgement Text',
|
|
186
|
+
name: 'acknowledgementText',
|
|
187
|
+
type: 'string',
|
|
188
|
+
default: 'Response recorded',
|
|
189
|
+
description: 'Toast shown for a button response, or message sent after a free-text response',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
displayName: 'Allowed User IDs',
|
|
193
|
+
name: 'allowedUserIds',
|
|
194
|
+
type: 'string',
|
|
195
|
+
default: '',
|
|
196
|
+
placeholder: '123456789, 987654321',
|
|
197
|
+
description: 'Optional comma-separated Telegram user IDs. Empty allows any user in the chat.',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Disable Notification',
|
|
201
|
+
name: 'disableNotification',
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
default: false,
|
|
204
|
+
description: 'Whether to send the question silently',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Parse Mode',
|
|
208
|
+
name: 'parseMode',
|
|
209
|
+
type: 'options',
|
|
210
|
+
options: [
|
|
211
|
+
{ name: 'None', value: 'none' },
|
|
212
|
+
{ name: 'HTML', value: 'HTML' },
|
|
213
|
+
{ name: 'MarkdownV2', value: 'MarkdownV2' },
|
|
214
|
+
],
|
|
215
|
+
default: 'none',
|
|
216
|
+
description: 'How Telegram should parse formatting in the question',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: 'Remove Buttons After Response',
|
|
220
|
+
name: 'removeButtons',
|
|
221
|
+
type: 'boolean',
|
|
222
|
+
default: true,
|
|
223
|
+
description: 'Whether to remove inline buttons after the first response',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
displayName: 'Limit Wait Time',
|
|
229
|
+
name: 'limitWaitTime',
|
|
230
|
+
type: 'boolean',
|
|
231
|
+
default: false,
|
|
232
|
+
description: 'Whether to resume automatically if nobody responds',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
displayName: 'Wait Amount',
|
|
236
|
+
name: 'waitAmount',
|
|
237
|
+
type: 'number',
|
|
238
|
+
typeOptions: { minValue: 0.1, numberPrecision: 2 },
|
|
239
|
+
default: 1,
|
|
240
|
+
displayOptions: { show: { limitWaitTime: [true] } },
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
displayName: 'Wait Unit',
|
|
244
|
+
name: 'waitUnit',
|
|
245
|
+
type: 'options',
|
|
246
|
+
options: [
|
|
247
|
+
{ name: 'Days', value: 'days' },
|
|
248
|
+
{ name: 'Hours', value: 'hours' },
|
|
249
|
+
{ name: 'Minutes', value: 'minutes' },
|
|
250
|
+
],
|
|
251
|
+
default: 'hours',
|
|
252
|
+
displayOptions: { show: { limitWaitTime: [true] } },
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
};
|
|
256
|
+
this.methods = {
|
|
257
|
+
credentialTest: {
|
|
258
|
+
telegramAdvanceStoreApiTest: redisPendingStore_1.telegramAdvanceStoreApiTest,
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
async webhook() {
|
|
263
|
+
const response = this.getBodyData();
|
|
264
|
+
return {
|
|
265
|
+
webhookResponse: { ok: true },
|
|
266
|
+
workflowData: [[{ json: response }]],
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
async execute() {
|
|
270
|
+
var _a;
|
|
271
|
+
try {
|
|
272
|
+
const inputData = this.getInputData();
|
|
273
|
+
if (inputData.length === 0)
|
|
274
|
+
return [[]];
|
|
275
|
+
const chatId = String(this.getNodeParameter('chatId', 0)).trim();
|
|
276
|
+
const question = String(this.getNodeParameter('question', 0)).trim();
|
|
277
|
+
const responseType = this.getNodeParameter('responseType', 0);
|
|
278
|
+
const buttonsPerRow = this.getNodeParameter('buttonsPerRow', 0, 1);
|
|
279
|
+
const inputPlaceholder = this.getNodeParameter('inputPlaceholder', 0, '');
|
|
280
|
+
const options = this.getNodeParameter('options', 0, {});
|
|
281
|
+
if (!chatId || !question) {
|
|
282
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Chat ID and Question are required');
|
|
283
|
+
}
|
|
284
|
+
const responseOptions = (0, question_1.buildResponseOptions)(responseType, {
|
|
285
|
+
approveLabel: this.getNodeParameter('approveLabel', 0, ''),
|
|
286
|
+
approveValue: this.getNodeParameter('approveValue', 0, ''),
|
|
287
|
+
declineLabel: this.getNodeParameter('declineLabel', 0, ''),
|
|
288
|
+
declineValue: this.getNodeParameter('declineValue', 0, ''),
|
|
289
|
+
choices: this.getNodeParameter('choices', 0, {}),
|
|
290
|
+
});
|
|
291
|
+
const token = (0, crypto_1.randomBytes)(12).toString('hex');
|
|
292
|
+
const replyMarkup = (0, question_1.buildReplyMarkup)(responseType, token, responseOptions, Math.max(1, Math.min(8, buttonsPerRow)), inputPlaceholder);
|
|
293
|
+
const parseMode = String(options.parseMode || 'none');
|
|
294
|
+
const body = {
|
|
295
|
+
chat_id: chatId,
|
|
296
|
+
text: question,
|
|
297
|
+
disable_notification: options.disableNotification === true,
|
|
298
|
+
reply_markup: replyMarkup,
|
|
299
|
+
};
|
|
300
|
+
if (parseMode !== 'none')
|
|
301
|
+
body.parse_mode = parseMode;
|
|
302
|
+
const sentMessage = await (0, shared_1.telegramApiRequest)(this, 'sendMessage', body);
|
|
303
|
+
const limitWaitTime = this.getNodeParameter('limitWaitTime', 0, false);
|
|
304
|
+
const waitTill = (0, wait_1.getWaitTill)(limitWaitTime, this.getNodeParameter('waitAmount', 0, 1), this.getNodeParameter('waitUnit', 0, 'hours'));
|
|
305
|
+
const store = await (0, redisPendingStore_1.createPendingStore)(this);
|
|
306
|
+
try {
|
|
307
|
+
await store.save({
|
|
308
|
+
token,
|
|
309
|
+
resumeUrl: this.getSignedResumeUrl(),
|
|
310
|
+
chatId,
|
|
311
|
+
messageId: sentMessage.message_id,
|
|
312
|
+
responseType,
|
|
313
|
+
options: responseOptions,
|
|
314
|
+
allowedUserIds: (0, question_1.parseUserIds)(options.allowedUserIds),
|
|
315
|
+
acknowledgementText: String((_a = options.acknowledgementText) !== null && _a !== void 0 ? _a : 'Response recorded'),
|
|
316
|
+
removeButtons: options.removeButtons !== false,
|
|
317
|
+
createdAt: new Date().toISOString(),
|
|
318
|
+
...(limitWaitTime ? { expiresAt: waitTill.toISOString() } : {}),
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
finally {
|
|
322
|
+
store.close();
|
|
323
|
+
}
|
|
324
|
+
await this.putExecutionToWait(waitTill);
|
|
325
|
+
return [inputData];
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
if (this.continueOnFail()) {
|
|
329
|
+
return [
|
|
330
|
+
[
|
|
331
|
+
{
|
|
332
|
+
json: { error: error instanceof Error ? error.message : String(error) },
|
|
333
|
+
pairedItem: { item: 0 },
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
];
|
|
337
|
+
}
|
|
338
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.TelegramAdvance = TelegramAdvance;
|
|
343
|
+
//# sourceMappingURL=TelegramAdvance.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelegramAdvance.node.js","sourceRoot":"","sources":["../../../nodes/TelegramAdvance/TelegramAdvance.node.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAYrC,+CAAuE;AAIvE,0CAAmF;AACnF,4DAAuF;AACvF,sCAAqE;AACrE,kCAAqD;AAErD,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,+BA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
|
|
1
|
+
{
|
|
2
|
+
"node": "@catalogicus-international/n8n-nodes-telegram-advance.telegramAdvance",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Communication", "HITL"],
|
|
6
|
+
"subcategories": {
|
|
7
|
+
"HITL": ["Human in the Loop"]
|
|
8
|
+
},
|
|
9
|
+
"alias": ["telegram", "approval", "choice", "wait", "human", "product"],
|
|
10
|
+
"resources": {
|
|
11
|
+
"credentialDocumentation": [
|
|
12
|
+
{
|
|
13
|
+
"url": "https://core.telegram.org/bots/features#creating-a-new-bot"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"primaryDocumentation": [
|
|
17
|
+
{
|
|
18
|
+
"url": "https://github.com/catalogicus-international/n8n-nodes-telegram-advance#readme"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class TelegramAdvanceSend implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|