From fe028d675e23725865ace6e0a93cd2d5f8f467bc Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 30 Oct 2022 16:13:20 +0000 Subject: [PATCH] handle raw lines having message-tags --- app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 22310d4..29531fd 100644 --- a/app.js +++ b/app.js @@ -99,8 +99,15 @@ function truncated(array, cb) { function sync(cb) { client.raw('VERSION'); client.on('raw', (raw) => { + let i = 1; const msg = raw.line.split(' '); - if (msg[1] === '351') { + + // if the line has message-tags, the command index will be offset by 1 + if (msg[0][0] == '@') { + i++; + } + + if (msg[i] === '351') { return cb(); } });