@patricktobias86/node-red-telegram-account 1.1.17 → 1.1.18
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/docs/NODES.md +1 -1
- package/nodes/receiver.html +4 -0
- package/nodes/receiver.js +11 -0
- package/package.json +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.1.18] - 2026-01-05
|
|
6
|
+
### Fixed
|
|
7
|
+
- Receiver node now populates `payload.chatId` / `payload.senderId` when Telegram IDs arrive as numeric strings (common in debug/output), so downstream filters work reliably.
|
|
8
|
+
|
|
5
9
|
## [1.1.17] - 2026-01-05
|
|
6
10
|
### Fixed
|
|
7
11
|
- Receiver node now listens to Raw MTProto updates and derives sender/chat identity safely so valid messages (channel posts, anonymous admins, service messages, missing fromId) are no longer dropped.
|
package/docs/NODES.md
CHANGED
|
@@ -8,7 +8,7 @@ Below is a short description of each node. For a full list of configuration opti
|
|
|
8
8
|
|------|-------------|
|
|
9
9
|
| **config** | Configuration node storing API credentials and connection options. Other nodes reference this to share a Telegram client and reuse the session. Connections are tracked in a Map with a reference count so multiple nodes can wait for the same connection. |
|
|
10
10
|
| **auth** | Starts an interactive login flow. Produces a `stringSession` (available in both <code>msg.payload.stringSession</code> and <code>msg.stringSession</code>) that can be reused with the `config` node. |
|
|
11
|
-
| **receiver** | Emits an output message for every incoming Telegram message using Raw MTProto updates (so channel posts, anonymous admins and service messages are not missed). Can ignore specific user IDs, skip selected message types (e.g. videos or documents), and optionally drop media above a configurable size. Output includes derived `peer`, `sender`, `senderType`, `senderId`, `chatId`, `isSilent`, and `messageTypes`. Event handlers are automatically removed when the node is closed. |
|
|
11
|
+
| **receiver** | Emits an output message for every incoming Telegram message using Raw MTProto updates (so channel posts, anonymous admins and service messages are not missed). Can ignore specific user IDs, skip selected message types (e.g. videos or documents), and optionally drop media above a configurable size. Output includes derived `peer`, `sender`, `senderType`, `senderId`, `chatId`, `isSilent`, and `messageTypes`. `chatId` is normalized to the MTProto dialog id (userId for private chats, chatId for legacy groups, channelId for supergroups/channels — not the Bot API `-100...` form). Event handlers are automatically removed when the node is closed. |
|
|
12
12
|
| **command** | Listens for new messages and triggers when a message matches a configured command or regular expression. The event listener is cleaned up on node close to avoid duplicates. |
|
|
13
13
|
| **send-message** | Sends text messages or media files to a chat. Supports parse mode, buttons, scheduling, and more. |
|
|
14
14
|
| **send-files** | Uploads one or more files to a chat with optional caption, thumbnails and other parameters. |
|
package/nodes/receiver.html
CHANGED
|
@@ -99,6 +99,10 @@
|
|
|
99
99
|
<span class="property-type">object</span>
|
|
100
100
|
</dt>
|
|
101
101
|
<dd>The raw Telegram update object containing details about the incoming message, sender, chat, and metadata.</dd>
|
|
102
|
+
<dt>payload.chatId
|
|
103
|
+
<span class="property-type">number</span>
|
|
104
|
+
</dt>
|
|
105
|
+
<dd>The normalized conversation identifier (user ID for private chats, chat ID for legacy groups, channel ID for supergroups/channels).</dd>
|
|
102
106
|
</dl>
|
|
103
107
|
|
|
104
108
|
<h3>Configuration</h3>
|
package/nodes/receiver.js
CHANGED
|
@@ -188,6 +188,17 @@ const toSafeNumber = (value) => {
|
|
|
188
188
|
if (typeof value === 'number') {
|
|
189
189
|
return Number.isFinite(value) ? value : null;
|
|
190
190
|
}
|
|
191
|
+
if (typeof value === 'string') {
|
|
192
|
+
const trimmed = value.trim();
|
|
193
|
+
if (/^-?\d+$/.test(trimmed)) {
|
|
194
|
+
try {
|
|
195
|
+
return toSafeNumber(BigInt(trimmed));
|
|
196
|
+
} catch (err) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
191
202
|
if (typeof value === 'bigint') {
|
|
192
203
|
const result = Number(value);
|
|
193
204
|
return Number.isFinite(result) ? result : Number.MAX_SAFE_INTEGER;
|