const commands = [ {raw: "`/compare`", clickable: ""}, {raw: "`/relay set`", clickable: ""}, {raw: "`/relay update`", clickable: ""}, {raw: "`/relay disable`", clickable: ""}, {raw: "`/rolemenu`", clickable: ""}, {raw: "`/watertime`", clickable: ""}, {raw: "`/timetoheight`", clickable: ""}, {raw: "`/setup compare`", clickable: ""}, {raw: "`/setup view`", clickable: ""}, {raw: "`/setup reset`", clickable: ""}, {raw: "`/help`", clickable: ""}, {raw: "`/tree`", clickable: ""}, {raw: "`/top trees`", clickable: ""}, {raw: "`/commands`", clickable: ""} ]; const fs = require('fs'); const replaceAll = require('string.prototype.replaceall'); const path = "./modules/input.txt"; const string = fs.readFileSync(path).toString(); let newString = replaceAll(string, '\* ', ''); newString = replaceAll(newString, '\n', '\\n'); newString = replaceAll(newString, '\t', ' - '); commands.forEach(command => { newString = replaceAll(newString, command.raw, command.clickable); }); newString = replaceAll(newString, '`', '``'); fs.writeFileSync(path, newString); return "Done";