We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4dd6a6 commit 7404e75Copy full SHA for 7404e75
lib/read.js
@@ -14,10 +14,16 @@ function processRead(msg, cfg) {
14
var startRow = cfg.reader ? cfg.reader.startRow || 0 : 0;
15
16
17
+ console.log('Incoming message is %j', msg);
18
if (!csvURL || csvURL.length == 0) {
- console.error('URL of the CSV is missing');
19
- that.emit('error', 'URL of the CSV is missing');
20
- return that.emit('end');
+ // Now let's check for the attachment
+ if (msg && msg.attachments && msg.attachments.length > 0) {
21
+ csvURL = msg.attachments[0].url
22
+ } else {
23
+ console.error('URL of the CSV is missing');
24
+ that.emit('error', 'URL of the CSV is missing');
25
+ return that.emit('end');
26
+ }
27
}
28
var parser = csv.parse({delimiter: separator});
29
0 commit comments