Advertisement
Guest User

Untitled

a guest
May 25th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. CODE:
  2.  
  3. bot.addListener("message", function(from, to, text, message){
  4. function seen(input, func){
  5. if (text.indexOf("!!" + input) == 0){
  6. func(message.slice(input.length + 3))
  7. }
  8. }
  9. seen("insult", function(input){
  10. bot.say(to, "Fuck you, " + (input == "" ? from : input))
  11. });
  12. seen("add", function(input){
  13. if (isNaN(input)){
  14. number++;
  15. }
  16. else{
  17. number += input
  18. }
  19. bot.say(to, "It's " + number)
  20. });
  21. });
  22.  
  23. ERROR:
  24.  
  25. maxell@MAXELL-PC E:\sd
  26. > node app.js
  27. E:\sd\node_modules\irc\lib\irc.js:748
  28. throw err;
  29. ^
  30. TypeError: undefined is not a function
  31. at seen (E:\sd\app.js:10:17)
  32. at Client.<anonymous> (E:\sd\app.js:16:2)
  33. at Client.emit (events.js:118:17)
  34. at Client.<anonymous> (E:\sd\node_modules\irc\lib\irc.js:517:22)
  35. at Client.emit (events.js:107:17)
  36. at iterator (E:\sd\node_modules\irc\lib\irc.js:745:26)
  37. at Array.forEach (native)
  38. at Socket.<anonymous> (E:\sd\node_modules\irc\lib\irc.js:740:15)
  39. at Socket.emit (events.js:107:17)
  40. at readableAddChunk (_stream_readable.js:163:16)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement