Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CODE:
- bot.addListener("message", function(from, to, text, message){
- function seen(input, func){
- if (text.indexOf("!!" + input) == 0){
- func(message.slice(input.length + 3))
- }
- }
- seen("insult", function(input){
- bot.say(to, "Fuck you, " + (input == "" ? from : input))
- });
- seen("add", function(input){
- if (isNaN(input)){
- number++;
- }
- else{
- number += input
- }
- bot.say(to, "It's " + number)
- });
- });
- ERROR:
- maxell@MAXELL-PC E:\sd
- > node app.js
- E:\sd\node_modules\irc\lib\irc.js:748
- throw err;
- ^
- TypeError: undefined is not a function
- at seen (E:\sd\app.js:10:17)
- at Client.<anonymous> (E:\sd\app.js:16:2)
- at Client.emit (events.js:118:17)
- at Client.<anonymous> (E:\sd\node_modules\irc\lib\irc.js:517:22)
- at Client.emit (events.js:107:17)
- at iterator (E:\sd\node_modules\irc\lib\irc.js:745:26)
- at Array.forEach (native)
- at Socket.<anonymous> (E:\sd\node_modules\irc\lib\irc.js:740:15)
- at Socket.emit (events.js:107:17)
- at readableAddChunk (_stream_readable.js:163:16)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement