@patricktobias86/node-red-telegram-account 1.1.22 → 1.2.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/CHANGELOG.md +4 -0
- package/README.md +2 -2
- package/docs/NODES.md +1 -1
- package/nodes/auth.html +1 -1
- package/nodes/auth.js +2 -2
- package/nodes/command.js +1 -1
- package/nodes/config.js +2 -2
- package/nodes/iter-dialogs.js +1 -1
- package/nodes/iter-messages.js +1 -1
- package/nodes/promote-admin.html +2 -2
- package/nodes/promote-admin.js +4 -4
- package/nodes/receiver.js +1 -1
- package/nodes/send-message.html +1 -1
- package/nodes/send-message.js +2 -2
- package/package.json +3 -3
- package/teleproto-1.221.2.tgz +0 -0
- package/test/auth.test.js +2 -2
- package/test/command.test.js +1 -1
- package/test/config.test.js +2 -2
- package/test/debug-option.test.js +1 -1
- package/test/pass-through.test.js +2 -2
- package/test/receiver-debug.test.js +1 -1
- package/test/receiver.test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.2.0] - 2026-01-12
|
|
6
|
+
### Changed
|
|
7
|
+
- Switched underlying Telegram MTProto client dependency from `telegram` (GramJS) to `teleproto`.
|
|
8
|
+
|
|
5
9
|
## [1.1.22] - 2026-01-12
|
|
6
10
|
### Fixed
|
|
7
11
|
- Receiver node now handles additional MTProto update types that were being silently dropped:
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Node-RED nodes to communicate with
|
|
1
|
+
# Node-RED nodes to communicate with TeleProto
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img alt="GitHub issues" src="https://img.shields.io/github/issues/patricktobias86/node-red-telegram-account?color=56BEB8" />
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
npm i @patricktobias86/node-red-telegram-account
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This package contains a collection of Node‑RED nodes built on top of [
|
|
13
|
+
This package contains a collection of Node‑RED nodes built on top of [TeleProto](https://www.npmjs.com/package/teleproto). They make it easier to interact with the Telegram MTProto API from your flows.
|
|
14
14
|
|
|
15
15
|
## Node overview
|
|
16
16
|
|
package/docs/NODES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Node Overview
|
|
2
2
|
|
|
3
|
-
The package provides a set of custom Node-RED nodes built around the [
|
|
3
|
+
The package provides a set of custom Node-RED nodes built around the [TeleProto](https://www.npmjs.com/package/teleproto) library. Each node exposes a small part of the Telegram API, making it easier to build Telegram bots and automation flows.
|
|
4
4
|
|
|
5
5
|
Below is a short description of each node. For a full list of configuration options see the built‑in help inside Node‑RED or open the corresponding HTML files in the `nodes/` directory.
|
|
6
6
|
|
package/nodes/auth.html
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</script>
|
|
85
85
|
|
|
86
86
|
<script type="text/html" data-help-name="auth">
|
|
87
|
-
<p>The <b>auth</b> node facilitates Telegram API authentication using the <code>
|
|
87
|
+
<p>The <b>auth</b> node facilitates Telegram API authentication using the <code>teleproto</code> library. It allows users to authenticate a session and retrieve a <code>stringSession</code> for reuse with other Telegram clients.</p>
|
|
88
88
|
<p>Enable <b>Debug</b> to log the incoming credentials and returned session.</p>
|
|
89
89
|
|
|
90
90
|
<h3>Inputs</h3>
|
package/nodes/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { TelegramClient } = require("
|
|
2
|
-
const { StringSession } = require("
|
|
1
|
+
const { TelegramClient } = require("teleproto");
|
|
2
|
+
const { StringSession } = require("teleproto/sessions");
|
|
3
3
|
|
|
4
4
|
module.exports = function (RED) {
|
|
5
5
|
function TelegramClientConfig(config) {
|
package/nodes/command.js
CHANGED
package/nodes/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { TelegramClient } = require("
|
|
2
|
-
const { StringSession } = require("
|
|
1
|
+
const { TelegramClient } = require("teleproto");
|
|
2
|
+
const { StringSession } = require("teleproto/sessions");
|
|
3
3
|
|
|
4
4
|
const activeClients = new Map(); // Cache: session string → { client, refCount, connecting }
|
|
5
5
|
|
package/nodes/iter-dialogs.js
CHANGED
package/nodes/iter-messages.js
CHANGED
package/nodes/promote-admin.html
CHANGED
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
|
|
198
198
|
</script>
|
|
199
199
|
<script type="text/html" data-help-name="promote-admin">
|
|
200
|
-
<p><b>Promote Admin</b> lets you promote a user to admin in a Telegram group or channel using the Telegram MTProto API (via
|
|
200
|
+
<p><b>Promote Admin</b> lets you promote a user to admin in a Telegram group or channel using the Telegram MTProto API (via TeleProto).</p>
|
|
201
201
|
<p>With <b>Debug</b> enabled the node logs its request and the response from Telegram.</p>
|
|
202
202
|
|
|
203
203
|
<h3>Inputs</h3>
|
|
@@ -249,4 +249,4 @@
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
</pre>
|
|
252
|
-
</script>
|
|
252
|
+
</script>
|
package/nodes/promote-admin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const { TelegramClient } = require("
|
|
2
|
-
const { parseID } = require("
|
|
3
|
-
const { Api } = require("
|
|
1
|
+
const { TelegramClient } = require("teleproto");
|
|
2
|
+
const { parseID } = require("teleproto/Utils");
|
|
3
|
+
const { Api } = require("teleproto");
|
|
4
4
|
|
|
5
5
|
module.exports = function (RED) {
|
|
6
6
|
function PromoteAdmin(config) {
|
|
@@ -56,4 +56,4 @@ module.exports = function (RED) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
RED.nodes.registerType("promote-admin", PromoteAdmin);
|
|
59
|
-
};
|
|
59
|
+
};
|
package/nodes/receiver.js
CHANGED
package/nodes/send-message.html
CHANGED
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
</script>
|
|
221
221
|
|
|
222
222
|
<script type="text/html" data-help-name="send-message">
|
|
223
|
-
<p>The <b>send-message</b> node allows sending messages via Telegram using the <code>
|
|
223
|
+
<p>The <b>send-message</b> node allows sending messages via Telegram using the <code>teleproto</code> library. It supports various message types, formatting options, and additional features like scheduling and silent messages.</p>
|
|
224
224
|
<p>Enable the <b>Debug</b> option to log incoming and outgoing messages to the Node-RED log.</p>
|
|
225
225
|
|
|
226
226
|
<h3>Inputs</h3>
|
package/nodes/send-message.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { TelegramClient } = require("
|
|
2
|
-
const { parseID } = require("
|
|
1
|
+
const { TelegramClient } = require("teleproto");
|
|
2
|
+
const { parseID } = require("teleproto/Utils");
|
|
3
3
|
|
|
4
4
|
module.exports = function (RED) {
|
|
5
5
|
function SendMessage(config) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patricktobias86/node-red-telegram-account",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Node-RED nodes to communicate with
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Node-RED nodes to communicate with TeleProto.",
|
|
5
5
|
"main": "nodes/config.js",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"node-red",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"registry": "https://registry.npmjs.org"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"
|
|
47
|
+
"teleproto": "^1.221.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"mocha": "^11.7.1",
|
|
Binary file
|
package/test/auth.test.js
CHANGED
|
@@ -29,8 +29,8 @@ function setup() {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
proxyquire('../nodes/auth.js', {
|
|
32
|
-
|
|
33
|
-
'
|
|
32
|
+
teleproto: { TelegramClient: TelegramClientStub },
|
|
33
|
+
'teleproto/sessions': { StringSession: StringSessionStub }
|
|
34
34
|
})(RED);
|
|
35
35
|
|
|
36
36
|
return { NodeCtor, getSent: () => sent };
|
package/test/command.test.js
CHANGED
package/test/config.test.js
CHANGED
|
@@ -32,8 +32,8 @@ function load() {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
proxyquire('../nodes/config.js', {
|
|
35
|
-
|
|
36
|
-
'
|
|
35
|
+
teleproto: { TelegramClient: TelegramClientStub },
|
|
36
|
+
'teleproto/sessions': { StringSession: StringSessionStub }
|
|
37
37
|
})(RED);
|
|
38
38
|
|
|
39
39
|
return { NodeCtor, instances };
|
|
@@ -20,8 +20,8 @@ function setup() {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
proxyquire('../nodes/send-message.js', {
|
|
23
|
-
|
|
24
|
-
'
|
|
23
|
+
teleproto: { TelegramClient: function() {} },
|
|
24
|
+
'teleproto/Utils': { parseID: () => ({}) }
|
|
25
25
|
})(RED);
|
|
26
26
|
|
|
27
27
|
return { NodeCtor, getSent: () => sent };
|