const child_process = require("child_process") var commits = child_process.execSync("git rev-list --count HEAD").toString().trim() var responses = [ { "type": "random", "keywords": [ ["teto"], ["commit", "version"] ], "replies": [ () => { return `I am on commit ${commits}. Yowzers!!!` } ] }, { "type": "random", "keywords": [ ["love"], ["teto"] ], "replies": [ "And I love you, random citizen!", ":D" ] }, { "type": "random", "keywords": [ ["teto"], ["hate", "despise", "die"] ], "replies": [ "D:", ":(", ":c", ">:(", "Rude...", "FUCK YOU!", "FUCK YOU BITCH DIE!!!!", "You gonna stay on my dick until you die! You serve no purpose in life. Your purpose in life is being on my stream sucking on my dick daily! Your purpose is being in that chat blowing that dick daily! Your life is nothing! You serve zero purpose! You should kill yourself now! And give somebody else a piece of that oxygen and ozone layer, that's covered up so we can breathe inside this blue trapped bubble. Because what are you here for? To worship me? Kill yourself. I mean that, with a hundred percent. With a thousand percent." ] }, { "type": "random", "keywords": [ ["teto"], ["sorry", "my bad", "apologies", "forgive"] ], "replies": [ "None is forgiven. You will all pay for your sins one day." ] }, { "type": "random", "keywords": [ ["teto"], ["card", "credit", "debit", "social", "security", "phone"], ["number", "digits"] ], "replies": [ () => { var numbers = [] for (var i = 0; i < 4; i++) { numbers.push(Math.floor(Math.random() * 9999).toString().padStart(4, '0')) } return `It's ${numbers.join("-")}, or something!` } ] }, { "type": "random", "keywords": [ ["teto"], ["thank"] ], "replies": [ ":TetoThumbs:", "Your welcome!!!", "Anytime!!!" ] }, { "type": "random", "keywords": [ ["teto"], ["do", "finish", "complete"], ["work", "school"] ], "replies": [ "Absolutely not.", "No.", "Never.", "Die in a fire." ] }, { "type": "random", "keywords": [ ["teto"], ["right"] ], "replies": [ "Sure?", "Yup!", "Yeah!!!" ] } ] let allTrue = arr => arr.every(v => v === true) var rndArray = (arr) => { var numb = Math.floor(Math.random() * arr.length) return arr[numb] } module.exports = { "message": (message) => { var content = message.content.toLowerCase() for (var i in responses) { var response = responses[i] var conditions = Array(response.keywords.length).fill(false) for (var y in response.keywords) { for (var x in response.keywords[y]) { var keyword = response.keywords[y][x] if (content.includes(keyword)) conditions[y] = true; } } if (allTrue(conditions)) { if (response.type == "random") { var reply = rndArray(response.replies) if (typeof reply == 'function') { reply = reply(message) } message.reply(reply) break } } } } }