Skip to content

Commit

Permalink
handle raw lines having message-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jesopo authored and Gottox committed Oct 30, 2022
1 parent 791d768 commit fe028d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
Expand Down

0 comments on commit fe028d6

Please sign in to comment.