~noisytoot/randomsync

43a618f34d9970a80677516d10af92d5740cc527 — Ron Nazarov 1 year, 2 months ago 1901382
Fix hardcoded bytes-max (64) in error messages
1 files changed, 4 insertions(+), 4 deletions(-)

M randomsync.js
M randomsync.js => randomsync.js +4 -4
@@ 187,7 187,7 @@ client.on('privmsg', msg => {
                }
                let bytes = parseInt(args[1])
                if (bytes == NaN || bytes <= 0 || bytes > config['bytes-max']) {
                    client.say(msg.target, 'ERROR Invalid byte amount (max: 64)')
                    client.say(msg.target, 'ERROR Invalid byte amount (max: ' + config['bytes-max'] + ')')
                    break
                }
                client.say(msg.target, '$RANDSYNCv2$ SEND !random-sync ' + getRandom(bytes).toString('base64'))


@@ 201,7 201,7 @@ client.on('privmsg', msg => {
                if (nick == client.user.nick) {
                    let bytes = parseInt(args[2])
                    if (bytes == NaN || bytes <= 0 || bytes > config['bytes-max']) {
                        client.say(msg.target, 'ERROR Invalid byte amount (max: 64)')
                        client.say(msg.target, 'ERROR Invalid byte amount (max: ' + config['bytes-max'] + ')')
                        break
                    }
                    client.say(msg.target, '$RANDSYNCv2$ SEND !random-sync ' + getRandom(bytes).toString('base64'))


@@ 220,7 220,7 @@ client.on('privmsg', msg => {
                }
                let bytes = parseInt(args[1])
                if (bytes == NaN || bytes <= 0 || bytes > config['bytes-max']) {
                    client.say(msg.target, 'ERROR ' + msg.nick + ' Invalid byte amount (max: 64)')
                    client.say(msg.target, 'ERROR ' + msg.nick + ' Invalid byte amount (max: ' + config['bytes-max'] + ')')
                    break
                }
                client.say(msg.target, '$RANDSYNCv1$ RESPOND ' + msg.nick + ' !random-sync ' + getRandom(bytes).toString('base64'))


@@ 234,7 234,7 @@ client.on('privmsg', msg => {
                if (nick == client.user.nick) {
                    let bytes = parseInt(args[2])
                    if (bytes == NaN || bytes <= 0 || bytes > config['bytes-max']) {
                        client.say(msg.target, 'ERROR ' + msg.nick + ' Invalid byte amount (max: 64)')
                        client.say(msg.target, 'ERROR ' + msg.nick + ' Invalid byte amount (max: ' + config['bytes-max'] + ')')
                        break
                    }
                    client.say(msg.target, '$RANDSYNCv1$ RESPOND ' + msg.nick + ' ' + getRandom(bytes).toString('base64'))