const fs = require('fs'); module.exports = (robot) => { robot.hear(/vtfn|si t'es pas content/i, function (msg) { msg.send(":arrow_right: https://vatefairecuireunnem.com/"); }); robot.hear(/mlc/i, function (msg) { let bizbi = fs.readFileSync('scripts/inc/repliques-mlc.txt', 'utf8'); bizbi = bizbi.split('\n') function randomize(toRand) { resultRand = toRand[Math.floor(Math.random()*toRand.length)] return resultRand; } msg.send(randomize(bizbi)); }); }