@patricktobias86/node-red-telegram-account 1.1.20 → 1.1.21

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 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.21] - 2026-01-06
6
+ ### Fixed
7
+ - Receiver node now correctly handles messages from channels when the sender is an anonymous admin, ensuring such messages are processed and not dropped.
8
+
5
9
  ## [1.1.20] - 2026-01-05
6
10
  ### Added
7
11
  - Receiver node now emits debug events on a second output when Debug is enabled, so you can see internal logs in the Node-RED debug sidebar.
@@ -9,7 +9,11 @@
9
9
  ignore: { value:""},
10
10
  ignoreMessageTypes: { value: "" },
11
11
  debug: { value: false },
12
- maxFileSizeMb: { value: "" }
12
+ maxFileSizeMb: { value: "" },
13
+ includeChats: { value: "" },
14
+ excludeChats: { value: "" },
15
+ includeSenders: { value: "" },
16
+ excludeSenders: { value: "" }
13
17
  },
14
18
  inputs: 1,
15
19
  outputs: 2,
@@ -84,6 +88,50 @@
84
88
  style="width: 60%"
85
89
  />
86
90
  </div>
91
+ <div class="form-row">
92
+ <label for="node-input-includeChats">
93
+ <i class="fa fa-plus-circle"></i> Include chats
94
+ </label>
95
+ <textarea
96
+ id="node-input-includeChats"
97
+ placeholder="Enter chat IDs, one per line"
98
+ style="width: 60%"
99
+ ></textarea>
100
+ <p class="form-tips">Only listen to messages from these chats. Leave blank to include all.</p>
101
+ </div>
102
+ <div class="form-row">
103
+ <label for="node-input-excludeChats">
104
+ <i class="fa fa-minus-circle"></i> Exclude chats
105
+ </label>
106
+ <textarea
107
+ id="node-input-excludeChats"
108
+ placeholder="Enter chat IDs, one per line"
109
+ style="width: 60%"
110
+ ></textarea>
111
+ <p class="form-tips">Ignore messages from these chats. Leave blank to exclude none.</p>
112
+ </div>
113
+ <div class="form-row">
114
+ <label for="node-input-includeSenders">
115
+ <i class="fa fa-user-plus"></i> Include senders
116
+ </label>
117
+ <textarea
118
+ id="node-input-includeSenders"
119
+ placeholder="Enter sender IDs, one per line"
120
+ style="width: 60%"
121
+ ></textarea>
122
+ <p class="form-tips">Only listen to messages from these senders. Leave blank to include all.</p>
123
+ </div>
124
+ <div class="form-row">
125
+ <label for="node-input-excludeSenders">
126
+ <i class="fa fa-user-times"></i> Exclude senders
127
+ </label>
128
+ <textarea
129
+ id="node-input-excludeSenders"
130
+ placeholder="Enter sender IDs, one per line"
131
+ style="width: 60%"
132
+ ></textarea>
133
+ <p class="form-tips">Ignore messages from these senders. Leave blank to exclude none.</p>
134
+ </div>
87
135
  </script>
88
136
 
89
137
  <script type="text/html" data-help-name="receiver">
@@ -134,6 +182,26 @@
134
182
  <span class="property-type">number</span>
135
183
  </dt>
136
184
  <dd>Skip updates that include media exceeding this size. Leave blank to process all media.</dd>
185
+
186
+ <dt>Include chats
187
+ <span class="property-type">string</span>
188
+ </dt>
189
+ <dd>Newline-separated list of chat IDs to listen to. Leave blank to listen to all chats.</dd>
190
+
191
+ <dt>Exclude chats
192
+ <span class="property-type">string</span>
193
+ </dt>
194
+ <dd>Newline-separated list of chat IDs to ignore. Leave blank to exclude none.</dd>
195
+
196
+ <dt>Include senders
197
+ <span class="property-type">string</span>
198
+ </dt>
199
+ <dd>Newline-separated list of sender IDs to listen to. Leave blank to listen to all senders.</dd>
200
+
201
+ <dt>Exclude senders
202
+ <span class="property-type">string</span>
203
+ </dt>
204
+ <dd>Newline-separated list of sender IDs to ignore. Leave blank to exclude none.</dd>
137
205
  </dl>
138
206
 
139
207
  <h3>Details</h3>
package/nodes/receiver.js CHANGED
@@ -358,6 +358,11 @@ module.exports = function (RED) {
358
358
  ? maxFileSizeMb * 1024 * 1024
359
359
  : null;
360
360
 
361
+ const includeChats = splitList(config.includeChats || "");
362
+ const excludeChats = splitList(config.excludeChats || "");
363
+ const includeSenders = splitList(config.includeSenders || "");
364
+ const excludeSenders = splitList(config.excludeSenders || "");
365
+
361
366
  const extractPhotoSize = (photo) => {
362
367
  if (!photo || !Array.isArray(photo.sizes)) {
363
368
  return null;
@@ -438,7 +443,13 @@ module.exports = function (RED) {
438
443
  node.send([null, { payload }]);
439
444
  };
440
445
 
441
- const event = new Raw({});
446
+ let rawOptions = {};
447
+ if (includeChats.length > 0) rawOptions.chats = includeChats;
448
+ if (excludeChats.length > 0) rawOptions.blacklistChats = excludeChats;
449
+ if (includeSenders.length > 0) rawOptions.senders = includeSenders;
450
+ if (excludeSenders.length > 0) rawOptions.blacklistSenders = excludeSenders;
451
+
452
+ const event = new Raw(rawOptions);
442
453
  const handler = (rawUpdate) => {
443
454
  const debug = node.debugEnabled;
444
455
  if (debug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patricktobias86/node-red-telegram-account",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "Node-RED nodes to communicate with GramJS.",
5
5
  "main": "nodes/config.js",
6
6
  "keywords": [