CameronFitzy

Cleetus chatbot

Jul 26th, 2020 (edited)
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function readA(a) {var punctuation=a.replace(/[.,\/#!$%\^&\?”’@*;:{}=\-_`~()]/g,"");var capital=punctuation.toUpperCase();var makeString=capital.split(" ");return makeString};
  2.  
  3. var b=readA(a);
  4.  
  5. var greeting=["HI","HEY","HELLO"];
  6. var age=["AGE","OLD"];
  7. var birthday=["BIRTHDAY","BDAY"];
  8. var time=["TIME"];
  9. var live=["LIVE","STATE","FROM","LOCATION","LOCATED"];
  10. var game=["GAME","GAMES","VIDEO"];
  11.  
  12. function testGreeting(b) {return greeting.some(item => b.includes(item))};
  13. function testAge(b) {return age.some(item => b.includes(item))};
  14. function testBirthday(b) {return birthday.some(item => b.includes(item))};
  15. function testTime(b) {return time.some(item => b.includes(item))};
  16. function testLive(b) {return live.some(item => b.includes(item))};
  17. function testGame(b) {return game.some(item => b.includes(item))};
  18.  
  19. testGame(b)?"Cleetus mainly plays OSRS and League of Legends.":
  20. testTime(b)?"It is currently "+t+" where Cleetus lives.":
  21. testLive(b)?"Cleetus is from Denver, Colorado.":
  22. testBirthday(b)?"Cleetus’ birthday is July 15th.":
  23. testAge(b)?"Cleetus is currently 26 years old.":
  24. testGreeting(b)?"Hello, I’m a command designed to answer your questions about Cleetus.":
  25.  
  26. "”"+a+"” has no recognizable keywords. Please reformat your question or ask Cleetus directly."
Add Comment
Please, Sign In to add comment