Advertisement
Guest User

Hello

a guest
Jan 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1.  
  2. dotheprompt = function () {};
  3. promptcallback = function (message) {
  4. if (message.author.id !== "201765854990434304") {
  5. return;
  6. }
  7. if (message.content.match(/^y(es)?$/i)) {
  8. try {
  9. this.branch("y");
  10. lechannel.send(this.current.text);
  11. } catch (err) {
  12. lechannel.send("Thank you for answering questions about...chickens...");
  13. bot.removeListener("message", dotheprompt);
  14. }
  15. }
  16. if (message.content.match(/^n(o)?$/i)) {
  17. try {
  18. this.branch("n");
  19. lechannel.send(this.current.text);
  20. } catch (err) {
  21. lechannel.send("Thank you for answering questions about...chickens...");
  22. bot.removeListener("message", dotheprompt);
  23. }
  24. }
  25. };
  26. myprompt = new multiprompt("Do you like chickens?", promptcallback);
  27. myprompt.addBranch("y", "Do you like ducks as well?", promptcallback);
  28. myprompt.addBranch("n", "Do you dislike ducks as well?", promptcallback);
  29. myprompt.branch("y");
  30. myprompt.addBranch("y", "Do you like all birds?", promptcallback);
  31. myprompt.addBranch("n", "Do you only like chickens?", promptcallback);
  32. myprompt.toFirst();
  33. myprompt.branch("n");
  34. myprompt.addBranch("y", "Do you only like ducks?", promptcallback);
  35. myprompt.addBranch("n", "Do you dislike all birds?", promptcallback);
  36. myprompt.toFirst();
  37. dotheprompt = function (message) {
  38. myprompt.exec(message);
  39. };
  40. lechannel.send(myprompt.first.text);
  41. bot.on("message", dotheprompt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement