irc-lib
This commit is contained in:
parent
27a6cc515b
commit
f5c6a14def
737
package-lock.json
generated
737
package-lock.json
generated
@ -101,28 +101,6 @@
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
|
||||
"integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4="
|
||||
},
|
||||
"axon": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/axon/-/axon-1.0.0.tgz",
|
||||
"integrity": "sha1-syN7eLp0kujniZ5tWRjF9uqLz7U=",
|
||||
"requires": {
|
||||
"configurable": "0.0.1",
|
||||
"debug": "2.6.8",
|
||||
"escape-regexp": "0.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"configurable": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/configurable/-/configurable-0.0.1.tgz",
|
||||
"integrity": "sha1-R9dbcntRtOuEwdra/j+CQDE4M7E="
|
||||
},
|
||||
"escape-regexp": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz",
|
||||
"integrity": "sha1-9EvaEtRbvfnLf4Yu5+SCez3TIlQ="
|
||||
}
|
||||
}
|
||||
},
|
||||
"babel-cli": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz",
|
||||
@ -888,14 +866,6 @@
|
||||
"readdirp": "2.1.0"
|
||||
}
|
||||
},
|
||||
"cloudscraper": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/cloudscraper/-/cloudscraper-1.4.1.tgz",
|
||||
"integrity": "sha1-8rRDHzFyhtgZsTVyZso0Y7ES68o=",
|
||||
"requires": {
|
||||
"request": "2.81.0"
|
||||
}
|
||||
},
|
||||
"co": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||
@ -1048,11 +1018,6 @@
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
||||
"dev": true
|
||||
},
|
||||
"eventemitter2": {
|
||||
"version": "0.4.13",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.13.tgz",
|
||||
"integrity": "sha1-Coq5f5wbVjNhuJJ/noBgYndQkVM="
|
||||
},
|
||||
"eventemitter3": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
|
||||
@ -1161,685 +1126,6 @@
|
||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
||||
},
|
||||
"forever-monitor": {
|
||||
"version": "1.7.1",
|
||||
"resolved": "https://registry.npmjs.org/forever-monitor/-/forever-monitor-1.7.1.tgz",
|
||||
"integrity": "sha1-XYIPSjp42y2BriZx8Vi56GoJG7g=",
|
||||
"requires": {
|
||||
"broadway": "0.3.6",
|
||||
"chokidar": "1.7.0",
|
||||
"minimatch": "3.0.4",
|
||||
"ps-tree": "0.0.3",
|
||||
"utile": "0.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"anymatch": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz",
|
||||
"integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=",
|
||||
"requires": {
|
||||
"arrify": "1.0.1",
|
||||
"micromatch": "2.3.11"
|
||||
}
|
||||
},
|
||||
"arr-diff": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
|
||||
"integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
|
||||
"requires": {
|
||||
"arr-flatten": "1.1.0"
|
||||
}
|
||||
},
|
||||
"arr-flatten": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
|
||||
"integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg=="
|
||||
},
|
||||
"array-unique": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
|
||||
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM="
|
||||
},
|
||||
"arrify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
|
||||
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
|
||||
},
|
||||
"async": {
|
||||
"version": "0.2.10",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
|
||||
"integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E="
|
||||
},
|
||||
"async-each": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
|
||||
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"binary-extensions": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz",
|
||||
"integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.8",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
|
||||
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"braces": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
|
||||
"integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
|
||||
"requires": {
|
||||
"expand-range": "1.8.2",
|
||||
"preserve": "0.2.0",
|
||||
"repeat-element": "1.1.2"
|
||||
}
|
||||
},
|
||||
"broadway": {
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://registry.npmjs.org/broadway/-/broadway-0.3.6.tgz",
|
||||
"integrity": "sha1-fb7waLlUt5B5Jf1USWO1eKkCuno=",
|
||||
"requires": {
|
||||
"cliff": "0.1.9",
|
||||
"eventemitter2": "0.4.14",
|
||||
"nconf": "0.6.9",
|
||||
"utile": "0.2.1",
|
||||
"winston": "0.8.0"
|
||||
}
|
||||
},
|
||||
"chokidar": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
|
||||
"integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
|
||||
"requires": {
|
||||
"anymatch": "1.3.0",
|
||||
"async-each": "1.0.1",
|
||||
"glob-parent": "2.0.0",
|
||||
"inherits": "2.0.3",
|
||||
"is-binary-path": "1.0.1",
|
||||
"is-glob": "2.0.1",
|
||||
"path-is-absolute": "1.0.1",
|
||||
"readdirp": "2.1.0"
|
||||
}
|
||||
},
|
||||
"cliff": {
|
||||
"version": "0.1.9",
|
||||
"resolved": "https://registry.npmjs.org/cliff/-/cliff-0.1.9.tgz",
|
||||
"integrity": "sha1-ohHgnGo947oa8n0EnTASUNGIErw=",
|
||||
"requires": {
|
||||
"colors": "0.6.2",
|
||||
"eyes": "0.1.8",
|
||||
"winston": "0.8.0"
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
|
||||
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"cycle": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz",
|
||||
"integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI="
|
||||
},
|
||||
"event-stream": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-0.5.3.tgz",
|
||||
"integrity": "sha1-t3uTCfcQet3+q2PwwOr9jbC9jBw=",
|
||||
"requires": {
|
||||
"optimist": "0.2.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"optimist": {
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.2.8.tgz",
|
||||
"integrity": "sha1-6YGrfiaLRXlIWTtVZ0wJmoFcrDE=",
|
||||
"requires": {
|
||||
"wordwrap": "0.0.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eventemitter2": {
|
||||
"version": "0.4.14",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
|
||||
"integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas="
|
||||
},
|
||||
"expand-brackets": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
|
||||
"integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
|
||||
"requires": {
|
||||
"is-posix-bracket": "0.1.1"
|
||||
}
|
||||
},
|
||||
"expand-range": {
|
||||
"version": "1.8.2",
|
||||
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
|
||||
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
|
||||
"requires": {
|
||||
"fill-range": "2.2.3"
|
||||
}
|
||||
},
|
||||
"extglob": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
|
||||
"integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
|
||||
"requires": {
|
||||
"is-extglob": "1.0.0"
|
||||
}
|
||||
},
|
||||
"eyes": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
|
||||
"integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A="
|
||||
},
|
||||
"filename-regex": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
|
||||
"integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY="
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz",
|
||||
"integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=",
|
||||
"requires": {
|
||||
"is-number": "2.1.0",
|
||||
"isobject": "2.1.0",
|
||||
"randomatic": "1.1.7",
|
||||
"repeat-element": "1.1.2",
|
||||
"repeat-string": "1.6.1"
|
||||
}
|
||||
},
|
||||
"for-in": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
|
||||
"integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA="
|
||||
},
|
||||
"for-own": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
|
||||
"integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
|
||||
"requires": {
|
||||
"for-in": "1.0.2"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
},
|
||||
"glob-base": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
|
||||
"integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
|
||||
"requires": {
|
||||
"glob-parent": "2.0.0",
|
||||
"is-glob": "2.0.1"
|
||||
}
|
||||
},
|
||||
"glob-parent": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
|
||||
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
|
||||
"requires": {
|
||||
"is-glob": "2.0.1"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
||||
},
|
||||
"i": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/i/-/i-0.3.5.tgz",
|
||||
"integrity": "sha1-HSuFQVjsgWkRPGy39raAHpniEdU="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "1.4.0",
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz",
|
||||
"integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4="
|
||||
},
|
||||
"is-binary-path": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
|
||||
"integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
|
||||
"requires": {
|
||||
"binary-extensions": "1.8.0"
|
||||
}
|
||||
},
|
||||
"is-buffer": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
|
||||
"integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw="
|
||||
},
|
||||
"is-dotfile": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
|
||||
"integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE="
|
||||
},
|
||||
"is-equal-shallow": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
|
||||
"integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
|
||||
"requires": {
|
||||
"is-primitive": "2.0.0"
|
||||
}
|
||||
},
|
||||
"is-extendable": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
|
||||
"integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik="
|
||||
},
|
||||
"is-extglob": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
|
||||
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA="
|
||||
},
|
||||
"is-glob": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
|
||||
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
|
||||
"requires": {
|
||||
"is-extglob": "1.0.0"
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
|
||||
"integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
|
||||
"requires": {
|
||||
"kind-of": "3.2.2"
|
||||
}
|
||||
},
|
||||
"is-posix-bracket": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
|
||||
"integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q="
|
||||
},
|
||||
"is-primitive": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
|
||||
"integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU="
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"isobject": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
|
||||
"integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
|
||||
"requires": {
|
||||
"isarray": "1.0.0"
|
||||
}
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
|
||||
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
|
||||
"requires": {
|
||||
"is-buffer": "1.1.5"
|
||||
}
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "2.3.11",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
|
||||
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
|
||||
"requires": {
|
||||
"arr-diff": "2.0.0",
|
||||
"array-unique": "0.2.1",
|
||||
"braces": "1.8.5",
|
||||
"expand-brackets": "0.1.5",
|
||||
"extglob": "0.3.2",
|
||||
"filename-regex": "2.0.1",
|
||||
"is-extglob": "1.0.0",
|
||||
"is-glob": "2.0.1",
|
||||
"kind-of": "3.2.2",
|
||||
"normalize-path": "2.1.1",
|
||||
"object.omit": "2.0.1",
|
||||
"parse-glob": "3.0.4",
|
||||
"regex-cache": "0.4.3"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.8"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
|
||||
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||
}
|
||||
}
|
||||
},
|
||||
"nconf": {
|
||||
"version": "0.6.9",
|
||||
"resolved": "https://registry.npmjs.org/nconf/-/nconf-0.6.9.tgz",
|
||||
"integrity": "sha1-lXDvFe1vmuays8jV5xtm0xk81mE=",
|
||||
"requires": {
|
||||
"async": "0.2.9",
|
||||
"ini": "1.3.4",
|
||||
"optimist": "0.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": {
|
||||
"version": "0.2.9",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-0.2.9.tgz",
|
||||
"integrity": "sha1-32MGD789Myhqdqr21Vophtn/hhk="
|
||||
}
|
||||
}
|
||||
},
|
||||
"ncp": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz",
|
||||
"integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ="
|
||||
},
|
||||
"normalize-path": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
|
||||
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
|
||||
"requires": {
|
||||
"remove-trailing-separator": "1.0.2"
|
||||
}
|
||||
},
|
||||
"object.omit": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
|
||||
"integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
|
||||
"requires": {
|
||||
"for-own": "0.1.5",
|
||||
"is-extendable": "0.1.1"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"optimist": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz",
|
||||
"integrity": "sha1-aUJIJvNAX3nxQub8PZrljU27kgA=",
|
||||
"requires": {
|
||||
"minimist": "0.0.10",
|
||||
"wordwrap": "0.0.3"
|
||||
}
|
||||
},
|
||||
"parse-glob": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
|
||||
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
|
||||
"requires": {
|
||||
"glob-base": "0.3.0",
|
||||
"is-dotfile": "1.0.3",
|
||||
"is-extglob": "1.0.0",
|
||||
"is-glob": "2.0.1"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"pkginfo": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz",
|
||||
"integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE="
|
||||
},
|
||||
"preserve": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
|
||||
"integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
|
||||
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
|
||||
},
|
||||
"ps-tree": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-0.0.3.tgz",
|
||||
"integrity": "sha1-2/jXUqf+Ivp9WGNWiUmWEOknbdw=",
|
||||
"requires": {
|
||||
"event-stream": "0.5.3"
|
||||
}
|
||||
},
|
||||
"randomatic": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz",
|
||||
"integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==",
|
||||
"requires": {
|
||||
"is-number": "3.0.0",
|
||||
"kind-of": "4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-number": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
|
||||
"integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
|
||||
"requires": {
|
||||
"kind-of": "3.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"kind-of": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
|
||||
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
|
||||
"requires": {
|
||||
"is-buffer": "1.1.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
|
||||
"integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
|
||||
"requires": {
|
||||
"is-buffer": "1.1.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
|
||||
"integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"safe-buffer": "5.1.1",
|
||||
"string_decoder": "1.0.3",
|
||||
"util-deprecate": "1.0.2"
|
||||
}
|
||||
},
|
||||
"readdirp": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz",
|
||||
"integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"minimatch": "3.0.4",
|
||||
"readable-stream": "2.3.3",
|
||||
"set-immediate-shim": "1.0.1"
|
||||
}
|
||||
},
|
||||
"regex-cache": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz",
|
||||
"integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=",
|
||||
"requires": {
|
||||
"is-equal-shallow": "0.1.3",
|
||||
"is-primitive": "2.0.0"
|
||||
}
|
||||
},
|
||||
"remove-trailing-separator": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz",
|
||||
"integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE="
|
||||
},
|
||||
"repeat-element": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
|
||||
"integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo="
|
||||
},
|
||||
"repeat-string": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
|
||||
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
|
||||
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
|
||||
"requires": {
|
||||
"glob": "7.1.2"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
|
||||
},
|
||||
"set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
|
||||
},
|
||||
"stack-trace": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
|
||||
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.1"
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"utile": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz",
|
||||
"integrity": "sha1-kwyI6ZCY1iIINMNWy9mncFItkNc=",
|
||||
"requires": {
|
||||
"async": "0.2.10",
|
||||
"deep-equal": "1.0.1",
|
||||
"i": "0.3.5",
|
||||
"mkdirp": "0.5.1",
|
||||
"ncp": "0.4.2",
|
||||
"rimraf": "2.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"deep-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
|
||||
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"winston": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-0.8.0.tgz",
|
||||
"integrity": "sha1-YdCDD6aZcGISIGsKK1ymmpMENmg=",
|
||||
"requires": {
|
||||
"async": "0.2.10",
|
||||
"colors": "0.6.2",
|
||||
"cycle": "1.0.3",
|
||||
"eyes": "0.1.8",
|
||||
"pkginfo": "0.3.1",
|
||||
"stack-trace": "0.0.10"
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
|
||||
"integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
}
|
||||
}
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz",
|
||||
@ -2035,19 +1321,6 @@
|
||||
"loose-envify": "1.3.1"
|
||||
}
|
||||
},
|
||||
"irc-colors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/irc-colors/-/irc-colors-1.4.0.tgz",
|
||||
"integrity": "sha512-L5JLJsuYDh+deGY/bCes2fBm7ERiYtNHWc/wwmJ64Y0TimyjXthykAJX6Og7khbe4hgz04uUiM2EqXMa1n29zg=="
|
||||
},
|
||||
"irc-message": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/irc-message/-/irc-message-2.0.1.tgz",
|
||||
"integrity": "sha1-3AJ1lTmgMMlq82rW/I/ukIPffLw="
|
||||
},
|
||||
"irc-socket": {
|
||||
"version": "github:ircanywhere/irc-socket#19343600ce38460c9c8d7b7b265ac23313153342"
|
||||
},
|
||||
"is-binary-path": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
|
||||
@ -2263,11 +1536,6 @@
|
||||
"is-buffer": "1.1.6"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz",
|
||||
"integrity": "sha1-W3cjA03aTSYuWkb7LFjXzCL3FCA="
|
||||
},
|
||||
"loose-envify": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
|
||||
@ -2474,11 +1742,6 @@
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
"pause-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pause-queue/-/pause-queue-0.1.0.tgz",
|
||||
"integrity": "sha1-iS6rq3jCaoPW71ZQ6Wz3zSNnDKo="
|
||||
},
|
||||
"performance-now": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz",
|
||||
|
15
package.json
15
package.json
@ -2,26 +2,17 @@
|
||||
"name": "keinbotv3",
|
||||
"version": "0.0.1",
|
||||
"description": "Bot, kennste?",
|
||||
"main": "index.js",
|
||||
"main": "bot.js",
|
||||
"scripts": {
|
||||
"build": "./node_modules/.bin/babel src --presets=es2015 --plugins=add-module-exports --out-dir dist",
|
||||
"start": "npm run build && node inspect dist/index.js"
|
||||
"debug": "node --inspect=9229 dist/bot.js",
|
||||
"start": "npm run build && node dist/bot.js"
|
||||
},
|
||||
"author": "Flummi & jkhsjdhjs",
|
||||
"license": "WTFPL",
|
||||
"dependencies": {
|
||||
"axon": "1.0.0",
|
||||
"cloudscraper": "^1.4.1",
|
||||
"eventemitter2": "0.4.13",
|
||||
"forever-monitor": "^1.7.1",
|
||||
"irc-colors": "^1.4.0",
|
||||
"irc-message": "2.0.1",
|
||||
"irc-socket": "github:ircanywhere/irc-socket",
|
||||
"json-stringify-safe": "^5.0.0",
|
||||
"lodash": "2.4.1",
|
||||
"node-telegram-bot-api": "^0.29.0",
|
||||
"nodejs-mysql": "^0.1.3",
|
||||
"pause-queue": "~0.1.0",
|
||||
"safe-eval": "^0.3.0",
|
||||
"youtube-dl": "^1.12.2"
|
||||
},
|
||||
|
85
src/bot.js
85
src/bot.js
@ -1,87 +1,10 @@
|
||||
import { cfg, read } from './inc/cfg.js';
|
||||
import { wrapper } from './inc/wrapper.js';
|
||||
//const TelegramBot = require('node-telegram-bot-api');
|
||||
//const safeEval = require('safe-eval');
|
||||
//const util = require('util');
|
||||
//const fs = require('fs');
|
||||
//const ytdl = util.promisify(require('youtube-dl').getInfo);
|
||||
|
||||
|
||||
read().then(() => {
|
||||
let bot = new wrapper();
|
||||
|
||||
bot.on('message', msg => {
|
||||
console.log( msg );
|
||||
bot.on('message', e => {
|
||||
//console.log( e );
|
||||
e.reply( e.message );
|
||||
});
|
||||
});
|
||||
/*const lib = new (require(`${__dirname}/inc/lib`))(cfg);
|
||||
lib.events.on('message', msg => {
|
||||
if( msg.event[1] === "privmsg" ) {
|
||||
const e = lib.reply( msg );
|
||||
console.log( `IRC: (${e.time}) ${e.network} -> ${e.channel} -> ${e.user.nick}: ${e.message}` );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const bot = new TelegramBot("381368731:AAFalG-LknIbtBDuOvRXcxHUEK9Jg_o1UCw", { polling: true });
|
||||
bot.on('message', (msg) => {
|
||||
var e = lib.replytg(bot, msg);
|
||||
console.log( `TG: (${e.time}) ${e.channel} -> ${e.user.nick}: ${e.message}` );
|
||||
|
||||
switch(e.message) {
|
||||
case "1":
|
||||
e.reply("normal");
|
||||
break;
|
||||
default:
|
||||
//if(e.user.nick === "Flummi" || e.user.nick === "jkhsjdhjs" || e.user.nick === "Flummsi" || e.user.nick === "mrhanky" || e.user.nick === "gz") {
|
||||
if(e.message.match(/^\.js /)) { // JS-Sandbox
|
||||
let args = e.message.substring(3);
|
||||
var context = {
|
||||
e: e,
|
||||
msg: msg
|
||||
}
|
||||
try {
|
||||
var output = safeEval(args, context);
|
||||
if(typeof output !== undefined && output !== 'undefined' && output) {
|
||||
let blah = JSON.stringify( output );
|
||||
if(blah != "Converting circular structure to JSON")
|
||||
e.reply( blah.length > 250 ? `holy fuck, Ausgabe wäre viel zu lang! (${blah.length} Zeichen :DDDDDD)` : blah );
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
e.reply(err.message);
|
||||
}
|
||||
}
|
||||
else if(e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)) { // parser
|
||||
let links = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi);
|
||||
const args = [
|
||||
//"-j",
|
||||
//"-q",
|
||||
"--no-progress",
|
||||
"--no-warnings",
|
||||
"--no-check-certificate",
|
||||
"--max-filesize 500m",
|
||||
'-o "./tmp/%(title)s.%(ext)s"'
|
||||
];
|
||||
|
||||
Promise.all( links.map( link => checkRepost( link ) ) ) // repostcheck
|
||||
.then( res => Promise.all( res.map( link => ytdl(link) ) ) ) // get informations
|
||||
.then( res => {
|
||||
res.forEach( data => {
|
||||
e.reply( data.title );
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//}
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function checkRepost(link) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve( link );
|
||||
});
|
||||
}*/
|
||||
});
|
@ -1,243 +0,0 @@
|
||||
var child_process,
|
||||
axon = require('axon'),
|
||||
_ = require('lodash'),
|
||||
QueuePool = require(__dirname + '/queuepool').QueuePool,
|
||||
irc = require(__dirname + '/irc'),
|
||||
readWriteStream = require(__dirname + '/stub.js').ReadWriteNetStream,
|
||||
stringify = require('json-stringify-safe'),
|
||||
Events = irc.Events,
|
||||
Client = irc.Client,
|
||||
Clients = {};
|
||||
|
||||
function Api() {
|
||||
var self = this;
|
||||
|
||||
this._keepOpen = false;
|
||||
this._eventQueue = [];
|
||||
this._rpcClients = 0;
|
||||
// some internal settings
|
||||
|
||||
process.on('uncaughtException', function(err) {
|
||||
self.emit('uncaughtException', {message: stringify(err)});
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
|
||||
Api.prototype.getClient = function(key) {
|
||||
return Clients[key].irc.supported;
|
||||
}
|
||||
|
||||
Api.prototype.setupServer = function(options) {
|
||||
var self = this;
|
||||
|
||||
axon.codec.define('json', {
|
||||
encode: JSON.stringify,
|
||||
decode: JSON.parse
|
||||
});
|
||||
// setup a json codec
|
||||
|
||||
this._events = axon.socket('push');
|
||||
this._events.bind(options.events);
|
||||
this._events.format('json');
|
||||
// setup the events socket
|
||||
|
||||
this._events.on('connect', function() {
|
||||
self.emit('metadata', {pid: process.pid, incomingPort: options.rpc, outgoingPort: options.events});
|
||||
self.emit('synchronize', {keys: _.keys(Clients)});
|
||||
});
|
||||
// setup some events for our outbound port
|
||||
|
||||
this._rpc = axon.socket('sub-emitter');
|
||||
this._rpc.bind(options.rpc);
|
||||
// we also setup an inbound socket which uses the sub emitter
|
||||
|
||||
this._rpc.on('createClient', function(key, client, dummy) {
|
||||
self.unhookEvent(key, '*');
|
||||
// do this first
|
||||
|
||||
var user = self.createClient(key, client, dummy || false);
|
||||
// create the client
|
||||
|
||||
if (!user) {
|
||||
return false;
|
||||
}
|
||||
// bail
|
||||
|
||||
self.hookEvent(key, '*', function(object) {
|
||||
self.emit(this.event, {message: object});
|
||||
});
|
||||
// we're obviously using the rpc to create clients, so they don't
|
||||
// have an option to hook events, they just get the lot, and choose what they
|
||||
// wanna do with them on their incoming pipe
|
||||
});
|
||||
|
||||
//this._rpc.on('test', function(key, client, dummy)
|
||||
|
||||
this._rpc.on('destroyClient', function(key) {
|
||||
self.destroyClient(key);
|
||||
// delete client
|
||||
});
|
||||
|
||||
this._rpc.on('call', function(key, call, params) {
|
||||
if (!_.has(Clients, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var client = Clients[key];
|
||||
// get the client object
|
||||
|
||||
if (!_.has(Client.prototype, call)) {
|
||||
return false;
|
||||
}
|
||||
// property is undefined
|
||||
|
||||
if (_.isArray(params) && call !== 'raw') {
|
||||
Client.prototype[call].apply(client.irc, params);
|
||||
} else {
|
||||
Client.prototype[call].call(client.irc, params);
|
||||
}
|
||||
// call the function
|
||||
});
|
||||
};
|
||||
|
||||
Api.prototype.connect = function(options) {
|
||||
var self = this,
|
||||
interfaces = {
|
||||
events: axon.socket('pull'),
|
||||
rpc: axon.socket('pub-emitter')
|
||||
};
|
||||
// create these so our end-user doesn't have to
|
||||
|
||||
axon.codec.define('json', {
|
||||
encode: JSON.stringify,
|
||||
decode: JSON.parse
|
||||
});
|
||||
// setup a json codec
|
||||
|
||||
interfaces.rpc.connect(options.rpc);
|
||||
// setup our outgoing connection
|
||||
|
||||
interfaces.events.connect(options.events);
|
||||
interfaces.events.format('json');
|
||||
// setup our incoming connection
|
||||
|
||||
if (!options.automaticSetup) {
|
||||
return interfaces;
|
||||
}
|
||||
// just return interfaces if handleErrors is false
|
||||
|
||||
interfaces.events.on('socket error', function(e) {
|
||||
if (e.syscall === 'connect' && e.code === 'ECONNREFUSED') {
|
||||
self.setupServer(options);
|
||||
}
|
||||
});
|
||||
// socket error
|
||||
|
||||
return interfaces;
|
||||
}
|
||||
|
||||
Api.prototype.emit = function(event, data) {
|
||||
if (this._events) {
|
||||
this._events.send(_.extend({event: event}, data));
|
||||
} else {
|
||||
Events.emit(event, data);
|
||||
}
|
||||
}
|
||||
// ========================================
|
||||
|
||||
// ========================================
|
||||
// the following functions let us manage clients by creating
|
||||
// them, and destroying them
|
||||
|
||||
Api.prototype.createClient = function(key, object, dummy) {
|
||||
var self = this,
|
||||
dummy = dummy || false,
|
||||
socket = (dummy) ? readWriteStream : undefined;
|
||||
// we can create a dummy client with stub.js for testing purposes
|
||||
|
||||
if (_.has(Clients, key)) {
|
||||
return false;
|
||||
}
|
||||
// check if a client with this key exists, don't bother throwing, too risky to be
|
||||
// exiting the process over this sort of stuff.
|
||||
|
||||
Clients[key] = {
|
||||
key: key,
|
||||
options: object,
|
||||
dummy: dummy,
|
||||
irc: new Client(key, object, socket),
|
||||
events: {}
|
||||
};
|
||||
|
||||
this.hookEvent(key, 'failed', function(message) {
|
||||
setTimeout(function() {
|
||||
self.destroyClient(key);
|
||||
}, 1000);
|
||||
});
|
||||
// hook onto a failed event and destroy the client
|
||||
|
||||
this.hookEvent(key, 'throttled', function(message) {
|
||||
QueuePool.queuePause(object.server);
|
||||
});
|
||||
// hook onto a throttling event
|
||||
|
||||
return Clients[key];
|
||||
};
|
||||
|
||||
Api.prototype.destroyClient = function(key) {
|
||||
if (!_.has(Clients, key)) {
|
||||
return false;
|
||||
}
|
||||
// no client exists, lets bail
|
||||
|
||||
Clients[key].irc.disconnect();
|
||||
// send a disconnect to be nice
|
||||
|
||||
delete Clients[key].irc;
|
||||
delete Clients[key];
|
||||
|
||||
return true;
|
||||
};
|
||||
// ========================================
|
||||
|
||||
// ========================================
|
||||
// the following functions handle hooking onto events
|
||||
// and unhooking them
|
||||
|
||||
Api.prototype.hookEvent = function(key, e, callback, once) {
|
||||
var once = once || false;
|
||||
// check for once at the end, if so only apply event once
|
||||
|
||||
if (once) {
|
||||
Events.once([key, e], callback);
|
||||
} else {
|
||||
Events.off([key, e], callback);
|
||||
Events.on([key, e], callback);
|
||||
}
|
||||
// add the hook
|
||||
};
|
||||
|
||||
Api.prototype.unhookEvent = function(key, e, callback) {
|
||||
if (!callback) {
|
||||
Events.removeAllListeners([key, e]);
|
||||
} else {
|
||||
Events.off([key, e], callback);
|
||||
}
|
||||
// add the hook
|
||||
};
|
||||
// ========================================
|
||||
|
||||
Error.prototype.toJSON = function () {
|
||||
var json = {};
|
||||
Object.getOwnPropertyNames(this).forEach(addToJSON, this);
|
||||
return json;
|
||||
|
||||
function addToJSON(name) {
|
||||
var pd = Object.getOwnPropertyDescriptor(this, name);
|
||||
pd.enumerable = true;
|
||||
Object.defineProperty(json, name, pd);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Api = Api;
|
||||
exports.axon = axon;
|
@ -1,330 +0,0 @@
|
||||
module.exports = {
|
||||
'001': 'RPL_WELCOME',
|
||||
'002': 'RPL_YOURHOST', // RFC2812
|
||||
'003': 'RPL_CREATED', // RFC2812
|
||||
'004': 'RPL_MYINFO', // RFC2812
|
||||
'005': 'RPL_ISUPPORT', // draft-brocklesby-irc-isupport-03
|
||||
'008': 'RPL_SNOMASK', // ircu
|
||||
'009': 'RPL_STATMEMTOT', // ircu
|
||||
'010': 'RPL_REDIR', // ratbox
|
||||
'014': 'RPL_YOURCOOKIE', // IRCnet
|
||||
'015': 'RPL_MAP', // ircu
|
||||
'016': 'RPL_MAPMORE', // ircu
|
||||
'017': 'RPL_MAPEND', // ircu
|
||||
'020': 'RPL_CONNECTING', // IRCnet
|
||||
'042': 'RPL_YOURID', // IRCnet
|
||||
'043': 'RPL_SAVENICK', // IRCnet
|
||||
'050': 'RPL_ATTEMPTINGJUNC', // aircd
|
||||
'051': 'RPL_ATTEMPTINGREROUTE', // aircd
|
||||
|
||||
'200': 'RPL_TRACELINK', // RFC1459
|
||||
'201': 'RPL_TRACECONNECTING', // RFC1459
|
||||
'202': 'RPL_TRACEHANDSHAKE', // RFC1459
|
||||
'203': 'RPL_TRACEUNKNOWN', // RFC1459
|
||||
'204': 'RPL_TRACEOPERATOR', // RFC1459
|
||||
'205': 'RPL_TRACEUSER', // RFC1459
|
||||
'206': 'RPL_TRACESERVER', // RFC1459
|
||||
'207': 'RPL_TRACECAPTURED', // hybrid (RFC2812 TRACESERVICE)
|
||||
'208': 'RPL_TRACENEWTYPE', // RFC1459
|
||||
'209': 'RPL_TRACECLASS', // RFC2812
|
||||
'210': 'RPL_STATS', // aircd (single stats reply)
|
||||
'211': 'RPL_STATSLINKINFO', // RFC1459
|
||||
'212': 'RPL_STATSCOMMANDS', // RFC1459
|
||||
'213': 'RPL_STATSCLINE', // RFC1459
|
||||
'214': 'RPL_STATSNLINE', // RFC1459
|
||||
'215': 'RPL_STATSILINE', // RFC1459
|
||||
'216': 'RPL_STATSKLINE', // RFC1459
|
||||
'217': 'RPL_STATSQLINE', // RFC1459
|
||||
'218': 'RPL_STATSYLINE', // RFC1459
|
||||
'219': 'RPL_ENDOFSTATS', // RFC1459
|
||||
|
||||
'220': 'RPL_STATSPLINE', // hybrid
|
||||
'221': 'RPL_UMODEIS', // RFC1459
|
||||
'222': 'RPL_SQLINE_NICK', // DALnet
|
||||
'223': 'RPL_STATSGLINE', // Unreal
|
||||
'224': 'RPL_STATSFLINE', // hybrid
|
||||
'225': 'RPL_STATSDLINE', // hybrid
|
||||
'226': 'RPL_STATSALINE', // hybrid
|
||||
'227': 'RPL_STATSVLINE', // Unreal
|
||||
'228': 'RPL_STATSCCOUNT', // hybrid
|
||||
|
||||
'231': 'RPL_SERVICEINFO', // RFC1459
|
||||
'233': 'RPL_SERVICE', // RFC1459
|
||||
'234': 'RPL_SERVLIST', // RFC1459
|
||||
'235': 'RPL_SERVLISTEND', // RFC1459
|
||||
'239': 'RPL_STATSIAUTH', // IRCnet
|
||||
|
||||
'241': 'RPL_STATSLLINE', // RFC1459
|
||||
'242': 'RPL_STATSUPTIME', // RFC1459
|
||||
'243': 'RPL_STATSOLINE', // RFC1459
|
||||
'244': 'RPL_STATSHLINE', // RFC1459
|
||||
'245': 'RPL_STATSSLINE', // Bahamut, IRCnet, hybrid
|
||||
'247': 'RPL_STATSXLINE', // hybrid
|
||||
'248': 'RPL_STATSULINE', // hybrid
|
||||
'249': 'RPL_STATSDEBUG', // hybrid
|
||||
|
||||
'250': 'RPL_STATSCONN', // ircu, Unreal, hybrid
|
||||
'251': 'RPL_LUSERCLIENT', // RFC1459
|
||||
'252': 'RPL_LUSEROP', // RFC1459
|
||||
'253': 'RPL_LUSERUNKNOWN', // RFC1459
|
||||
'254': 'RPL_LUSERCHANNELS', // RFC1459
|
||||
'255': 'RPL_LUSERME', // RFC1459
|
||||
'256': 'RPL_ADMINME', // RFC1459
|
||||
'257': 'RPL_ADMINLOC1', // RFC1459
|
||||
'258': 'RPL_ADMINLOC2', // RFC1459
|
||||
'259': 'RPL_ADMINEMAIL', // RFC1459
|
||||
|
||||
'261': 'RPL_TRACELOG', // RFC1459
|
||||
'262': 'RPL_ENDOFTRACE', // hybrid
|
||||
'263': 'RPL_LOAD2HI', // hybrid
|
||||
'265': 'RPL_LOCALUSERS', // aircd, Bahamut, hybrid
|
||||
'266': 'RPL_GLOBALUSERS', // aircd, Bahamut, hybrid
|
||||
'267': 'RPL_START_NETSTAT', // aircd
|
||||
'268': 'RPL_NETSTAT', // aircd
|
||||
'269': 'RPL_END_NETSTAT', // aircd
|
||||
|
||||
'270': 'RPL_PRIVS', // ircu
|
||||
'271': 'RPL_SILELIST', // ircu
|
||||
'272': 'RPL_ENDOFSILELIST', // ircu
|
||||
'275': 'RPL_WHOISSSL', // oftc-hybrid
|
||||
'276': 'RPL_WHOISCERTFP', // oftc-hybrid
|
||||
|
||||
'280': 'RPL_GLIST', // ircu
|
||||
'281': 'RPL_ACCEPTLIST', // ratbox/chary
|
||||
'282': 'RPL_ENDOFACCEPT', // ratbox/chary
|
||||
|
||||
'300': 'RPL_NONE', // RFC1459
|
||||
'301': 'RPL_AWAY', // RFC1459
|
||||
'302': 'RPL_USERHOST', // RFC1459
|
||||
'303': 'RPL_ISON', // RFC1459
|
||||
'304': 'RPL_TEXT', // hybrid
|
||||
'305': 'RPL_UNAWAY', // RFC1459
|
||||
'306': 'RPL_NOWAWAY', // RFC1459
|
||||
'307': 'RPL_WHOISNICKSERVREG', // An issue of contention.
|
||||
'308': 'RPL_WHOISADMIN', // hybrid
|
||||
|
||||
'310': 'RPL_WHOISMODES', // Plexus
|
||||
'311': 'RPL_WHOISUSER', // RFC1459
|
||||
'312': 'RPL_WHOISSERVER', // RFC1459
|
||||
'313': 'RPL_WHOISOPERATOR', // RFC1459
|
||||
'314': 'RPL_WHOWASUSER', // RFC1459
|
||||
'315': 'RPL_ENDOFWHO', // RFC1459
|
||||
'316': 'RPL_WHOISCHANOP', // reserved in rb/chary
|
||||
'317': 'RPL_WHOISIDLE', // RFC1459
|
||||
'318': 'RPL_ENDOFWHOIS', // RFC1459
|
||||
'319': 'RPL_WHOISCHANNELS', // RFC1459
|
||||
|
||||
'321': 'RPL_LISTSTART', // RFC1459
|
||||
'322': 'RPL_LIST', // RFC1459
|
||||
'323': 'RPL_LISTEND', // RFC1459
|
||||
'324': 'RPL_CHANNELMODEIS', // RFC1459
|
||||
'325': 'RPL_CHANNELMLOCK', // sorircd 1.3
|
||||
'328': 'RPL_CHANNELURL', // ratbox/chary
|
||||
'329': 'RPL_CREATIONTIME', // Bahamut
|
||||
|
||||
'330': 'RPL_WHOISLOGGEDIN', // ratbox/chary
|
||||
'331': 'RPL_NOTOPIC', // RFC1459
|
||||
'332': 'RPL_TOPIC', // RFC1459
|
||||
'333': 'RPL_TOPICWHOTIME', // ircu
|
||||
'337': 'RPL_WHOISTEXT', // ratbox/chary
|
||||
'338': 'RPL_WHOISACTUALLY', // Bahamut, ircu
|
||||
|
||||
'340': 'RPL_USERIP', // ircu
|
||||
'341': 'RPL_INVITING', // RFC1459
|
||||
'342': 'RPL_SUMMONING', // RFC1459
|
||||
'345': 'RPL_INVITED', // GameSurge
|
||||
'346': 'RPL_INVITELIST', // RFC2812
|
||||
'347': 'RPL_ENDOFINVITELIST', // RFC2812
|
||||
'348': 'RPL_EXCEPTLIST', // RFC2812
|
||||
'349': 'RPL_ENDOFEXCEPTLIST', // RFC2812
|
||||
|
||||
'351': 'RPL_VERSION', // RFC1459
|
||||
'352': 'RPL_WHOREPLY', // RFC1459
|
||||
'353': 'RPL_NAMREPLY', // RFC1459
|
||||
'354': 'RPL_WHOSPCRPL', // ircu
|
||||
|
||||
'360': 'RPL_WHOWASREAL', // ratbox/chary
|
||||
'361': 'RPL_KILLDONE', // RFC1459
|
||||
'362': 'RPL_CLOSING', // RFC1459
|
||||
'363': 'RPL_CLOSEEND', // RFC1459
|
||||
'364': 'RPL_LINKS', // RFC1459
|
||||
'365': 'RPL_ENDOFLINKS', // RFC1459
|
||||
'366': 'RPL_ENDOFNAMES', // RFC1459
|
||||
'367': 'RPL_BANLIST', // RFC1459
|
||||
'368': 'RPL_ENDOFBANLIST', // RFC1459
|
||||
'369': 'RPL_ENDOFWHOWAS', // RFC1459
|
||||
|
||||
'371': 'RPL_INFO', // RFC1459
|
||||
'372': 'RPL_MOTD', // RFC1459
|
||||
'373': 'RPL_INFOSTART', // RFC1459
|
||||
'374': 'RPL_ENDOFINFO', // RFC1459
|
||||
'375': 'RPL_MOTDSTART', // RFC1459
|
||||
'376': 'RPL_ENDOFMOTD', // RFC1459
|
||||
'378': 'RPL_WHOISHOST', // charybdis
|
||||
|
||||
'381': 'RPL_YOUREOPER', // RFC1459
|
||||
'382': 'RPL_REHASHING', // RFC1459
|
||||
'383': 'RPL_YOURESERVICE', // RFC2812
|
||||
'384': 'RPL_MYPORTIS', // RFC1459
|
||||
'385': 'RPL_NOTOPERANYMORE', // AustHex, hybrid, Unreal
|
||||
'386': 'RPL_RSACHALLENGE', // ratbox
|
||||
|
||||
'391': 'RPL_TIME', // RFC1459
|
||||
'392': 'RPL_USERSSTART', // RFC1459
|
||||
'393': 'RPL_USERS', // RFC1459
|
||||
'394': 'RPL_ENDOFUSERS', // RFC1459
|
||||
'395': 'RPL_NOUSERS', // RFC1459
|
||||
'396': 'RPL_HOSTHIDDEN', // ircu
|
||||
|
||||
'401': 'ERR_NOSUCHNICK', // RFC1459
|
||||
'402': 'ERR_NOSUCHSERVER', // RFC1459
|
||||
'403': 'ERR_NOSUCHCHANNEL', // RFC1459
|
||||
'404': 'ERR_CANNOTSENDTOCHAN', // RFC1459
|
||||
'405': 'ERR_TOOMANYCHANNELS', // RFC1459
|
||||
'406': 'ERR_WASNOSUCHNICK', // RFC1459
|
||||
'407': 'ERR_TOOMANYTARGETS', // RFC1459
|
||||
'408': 'ERR_NOSUCHSERVICE', // RFC2812
|
||||
'409': 'ERR_NOORIGIN', // RFC1459
|
||||
|
||||
'410': 'ERR_INVALIDCAPCMD', // hybrid
|
||||
'411': 'ERR_NORECIPIENT', // RFC1459
|
||||
'412': 'ERR_NOTEXTTOSEND', // RFC1459
|
||||
'413': 'ERR_NOTOPLEVEL', // RFC1459
|
||||
'414': 'ERR_WILDTOPLEVEL', // RFC1459
|
||||
'415': 'ERR_BADMASK', // RFC2812
|
||||
'416': 'ERR_TOOMANYMATCHES', // ratbox
|
||||
|
||||
'421': 'ERR_UNKNOWNCOMMAND', // RFC1459
|
||||
'422': 'ERR_NOMOTD', // RFC1459
|
||||
'423': 'ERR_NOADMININFO', // RFC1459
|
||||
'424': 'ERR_FILEERROR', // RFC1459
|
||||
'425': 'ERR_NOOPERMOTD', // Unreal
|
||||
'429': 'ERR_TOOMANYAWAY', // Bahamut
|
||||
|
||||
'430': 'ERR_EVENTNICKCHANGE', // AustHex
|
||||
'431': 'ERR_NONICKNAMEGIVEN', // RFC1459
|
||||
'432': 'ERR_ERRONEUSNICKNAME', // RFC1459
|
||||
'433': 'ERR_NICKNAMEINUSE', // RFC1459
|
||||
'436': 'ERR_NICKCOLLISION', // RFC1459
|
||||
'437': 'ERR_UNAVAILRESOURCE', // hybrid
|
||||
'438': 'ERR_NICKTOOFAST', // hybrid
|
||||
'439': 'ERR_TARGETTOOFAST', // ircu
|
||||
|
||||
'440': 'ERR_SERVICESDOWN', // Bahamut, Unreal
|
||||
'441': 'ERR_USERNOTINCHANNEL', // RFC1459
|
||||
'442': 'ERR_NOTONCHANNEL', // RFC1459
|
||||
'443': 'ERR_USERONCHANNEL', // RFC1459
|
||||
'444': 'ERR_NOLOGIN', // RFC1459
|
||||
'445': 'ERR_SUMMONDISABLED', // RFC1459
|
||||
'446': 'ERR_USERSDISABLED', // RFC1459
|
||||
'447': 'ERR_NONICKCHANGE', // Unreal
|
||||
'449': 'ERR_NOTIMPLEMENTED', // ircu
|
||||
|
||||
'451': 'ERR_NOTREGISTERED', // RFC1459
|
||||
'455': 'ERR_HOSTILENAME', // Unreal
|
||||
'456': 'ERR_ACCEPTFULL', // hybrid
|
||||
'457': 'ERR_ACCEPTEXIST', // hybrid
|
||||
'458': 'ERR_ACCEPTNOT', // hybrid
|
||||
'459': 'ERR_NOHIDING', // Unreal
|
||||
|
||||
'460': 'ERR_NOTFORHALFOPS', // Unreal
|
||||
'461': 'ERR_NEEDMOREPARAMS', // RFC1459
|
||||
'462': 'ERR_ALREADYREGISTRED', // RFC1459
|
||||
'463': 'ERR_NOPERMFORHOST', // RFC1459
|
||||
'464': 'ERR_PASSWDMISMATCH', // RFC1459
|
||||
'465': 'ERR_YOUREBANNEDCREEP', // RFC1459
|
||||
'466': 'ERR_YOUWILLBEBANNED', // RFC1459
|
||||
'467': 'ERR_KEYSET', // RFC1459
|
||||
'469': 'ERR_LINKSET', // Unreal
|
||||
|
||||
'470': 'ERR_LINKCHANNEL', // charybdis
|
||||
'471': 'ERR_CHANNELISFULL', // RFC1459
|
||||
'472': 'ERR_UNKNOWNMODE', // RFC1459
|
||||
'473': 'ERR_INVITEONLYCHAN', // RFC1459
|
||||
'474': 'ERR_BANNEDFROMCHAN', // RFC1459
|
||||
'475': 'ERR_BADCHANNELKEY', // RFC1459
|
||||
'476': 'ERR_BADCHANMASK', // RFC2812
|
||||
'477': 'ERR_NEEDREGGEDNICK', // ratbox (REGONLYCHAN in hyb7)
|
||||
'478': 'ERR_BANLISTFULL', // ircu
|
||||
'479': 'ERR_BADCHANNAME', // hybrid
|
||||
|
||||
'480': 'ERR_SSLONLYCHAN', // ratbox
|
||||
'481': 'ERR_NOPRIVILEGES', // RFC1459
|
||||
'482': 'ERR_CHANOPRIVSNEEDED', // RFC1459
|
||||
'483': 'ERR_CANTKILLSERVER', // RFC1459
|
||||
'484': 'ERR_ISCHANSERVICE', // ratbox (ERR_RESTRICTED in hyb7)
|
||||
'485': 'ERR_BANNEDNICK', // ratbox
|
||||
'488': 'ERR_TSLESSCHAN', // IRCnet
|
||||
'489': 'ERR_VOICENEEDED', // ircu
|
||||
|
||||
'491': 'ERR_NOOPERHOST', // RFC1459
|
||||
'492': 'ERR_NOSERVICEHOST', // RFC1459
|
||||
'493': 'ERR_NOFEATURE', // ircu
|
||||
'494': 'ERR_OWNMODE', // Bahamut
|
||||
'495': 'ERR_BADLOGTYPE', // ircu
|
||||
'496': 'ERR_BADLOGSYS', // ircu
|
||||
'497': 'ERR_BADLOGVALUE', // ircu
|
||||
'498': 'ERR_ISOPERLCHAN', // ircu
|
||||
|
||||
'501': 'ERR_UMODEUNKNOWNFLAG', // RFC1459
|
||||
'502': 'ERR_USERSDONTMATCH', // RFC1459
|
||||
'503': 'ERR_GHOSTEDCLIENT', // hybrid
|
||||
'504': 'ERR_USERNOTONSERV', // hybrid
|
||||
|
||||
'513': 'ERR_WRONGPONG', // hybrid
|
||||
'517': 'ERR_DISABLED', // ircu
|
||||
'518': 'ERR_LONGMASK', // ircu
|
||||
|
||||
'521': 'ERR_LISTSYNTAX', // hybrid
|
||||
'522': 'ERR_WHOSYNTAX', // hybrid
|
||||
'523': 'ERR_WHOLIMITEXCEEDED', // hybrid
|
||||
'524': 'ERR_HELPNOTFOUND', // hybrid
|
||||
|
||||
'670': 'RPL_STARTTLS', // ircv3 tls-3.1
|
||||
'671': 'RPL_WHOISSECURE', // Unreal
|
||||
|
||||
'691': 'ERR_STARTTLS', // ircv3 tls-3.2
|
||||
|
||||
'702': 'RPL_MODLIST', // hybrid
|
||||
'703': 'RPL_ENDOFMODLIST', // hybrid
|
||||
'704': 'RPL_HELPSTART', // hybrid
|
||||
'705': 'RPL_HELPTXT', // hybrid
|
||||
'706': 'RPL_ENDOFHELP', // hybrid
|
||||
'707': 'ERR_TARGCHANGE', // ratbox
|
||||
|
||||
'710': 'RPL_KNOCK', // hybrid
|
||||
'711': 'RPL_KNOCKDLVR', // hybrid
|
||||
'712': 'ERR_TOOMANYKNOCK', // hybrid
|
||||
'713': 'ERR_CHANOPEN', // hybrid
|
||||
'714': 'ERR_KNOCKONCHAN', // hybrid
|
||||
'715': 'ERR_KNOCKDISABLED', // hybrid
|
||||
'716': 'RPL_TARGUMODEG', // hybrid
|
||||
'717': 'RPL_TARGNOTIFY', // hybrid
|
||||
'718': 'RPL_UMODEGMSG', // hybrid
|
||||
|
||||
'720': 'RPL_OMOTDSTART', // hybrid
|
||||
'721': 'RPL_OMOTD', // hybrid
|
||||
'722': 'RPL_ENDOFOMOTD', // hybrid
|
||||
'723': 'ERR_NOPRIVS', // hybrid
|
||||
'724': 'RPL_TESTMASK', // hybrid
|
||||
'725': 'RPL_TESTLINE', // hybrid
|
||||
'726': 'RPL_NOTESTLINE', // hybrid
|
||||
'727': 'RPL_TESTMASKGECOS', // ratbox
|
||||
'728': 'RPL_QUIETLIST', // charybdis
|
||||
'729': 'RPL_ENDOFQUIETLIST', // charybdis
|
||||
|
||||
'730': 'RPL_MONONLINE', // ircv3 monitor ext
|
||||
'731': 'RPL_MONOFFLINE', // ircv3 monitor ext
|
||||
'732': 'RPL_MONLIST', // ircv3 monitor ext
|
||||
'733': 'RPL_ENDOFMONLIST', // ircv3 monitor ext
|
||||
'734': 'ERR_MONLISTFULL', // ircv3 monitor ext
|
||||
|
||||
'740': 'RPL_RSACHALLENGE2', // ratbox
|
||||
'741': 'RPL_ENDOFRSACHALLENGE2', // ratbox
|
||||
|
||||
'900': 'RPL_SASLAUTHENTICATED', // charbydis / kiwiirc
|
||||
'903': 'RPL_SASLLOGGEDIN', // charbydis / kiwiirc
|
||||
'904': 'ERR_SASLNOTAUTHORISED', // charbydis / kiwiirc
|
||||
'906': 'ERR_SASLABORTED', // charbydis / kiwiirc
|
||||
'907': 'ERR_SASLALREADYAUTHED' // charbydis / kiwiirc
|
||||
};
|
1680
src/inc/irc/irc.js
1680
src/inc/irc/irc.js
File diff suppressed because it is too large
Load Diff
@ -1,125 +0,0 @@
|
||||
var _ = require('lodash'),
|
||||
Events = require(__dirname + '/irc').Events;
|
||||
|
||||
function ListCache() {
|
||||
this.lists = {};
|
||||
};
|
||||
|
||||
// ========================================
|
||||
// this object manages list caching, in a normal single client
|
||||
// scenario, grabbing the list on request is fine, but irc-factory
|
||||
// isnt really designed for single client usage
|
||||
// the ircanywhere use case requires lists to be available to all, for
|
||||
// all networks.
|
||||
|
||||
ListCache.prototype.requestList = function(ircObject, search, page, limit) {
|
||||
if (!Events) {
|
||||
Events = require(__dirname + '/irc').Events;
|
||||
}
|
||||
|
||||
var self = this,
|
||||
key = ircObject.key;
|
||||
|
||||
if (key === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.lists[key]) {
|
||||
this.createList(ircObject);
|
||||
ircObject.raw(['LIST']);
|
||||
|
||||
Events.once([ircObject.key, 'listend'], function() {
|
||||
self.filterList(ircObject, search, page, limit);
|
||||
});
|
||||
// no cache is available? request one and wait to filter it
|
||||
} else {
|
||||
self.filterList(ircObject, search, page, limit);
|
||||
// looks like we already have a cached list, pass it straight to filter
|
||||
}
|
||||
|
||||
clearTimeout(this.lists[key].deleteTimer);
|
||||
this.lists[key].deleteTimer = setTimeout(function() {
|
||||
delete self.lists[key];
|
||||
}, 600000);
|
||||
// lets set a timer to trash this data if its not been requested in a while (10min)
|
||||
// the only reason we cache it is to prevent people doing /list then /list, then /list
|
||||
// and blocking the process
|
||||
};
|
||||
|
||||
ListCache.prototype.filterList = function(ircObject, search, page, limit) {
|
||||
var key = ircObject.key,
|
||||
regex = new RegExp('(' + search + ')', 'i'),
|
||||
list = this.lists[key];
|
||||
|
||||
if (key === '' || !list) {
|
||||
return false;
|
||||
}
|
||||
// make sure the list exists
|
||||
|
||||
var output = {
|
||||
list: [],
|
||||
raw: [],
|
||||
search: search.replace(/[-[\]{}()+?.,\\^$|#\s]/g, "\$&").replace(/\(\.\*\)/g, '*'),
|
||||
page: page,
|
||||
limit: limit,
|
||||
time: new Date()
|
||||
};
|
||||
|
||||
var clone = _.cloneDeep(list.list);
|
||||
var buffer = _.sortBy(clone, function(channel) {
|
||||
return 0 - channel.users;
|
||||
});
|
||||
// sort it
|
||||
|
||||
buffer = _.filter(buffer, function(channel) {
|
||||
return regex.test(channel.channel);
|
||||
});
|
||||
// filter via the search parameters
|
||||
|
||||
buffer = _.take(_.rest(buffer, (page - 1) * limit), limit);
|
||||
// paginate
|
||||
|
||||
for (var c in buffer) {
|
||||
var channel = buffer[c];
|
||||
output.raw.push(channel.raw);
|
||||
delete buffer[c].raw;
|
||||
}
|
||||
// i don't really like this, but we pull .raw from channel objects
|
||||
// and push it into the output
|
||||
|
||||
Events.emit([ircObject.key, 'list'], _.extend(output, {
|
||||
list: buffer
|
||||
}));
|
||||
// emit the list event
|
||||
};
|
||||
|
||||
ListCache.prototype.createList = function(ircObject) {
|
||||
var key = ircObject.key;
|
||||
if (key === '' || this.lists[key]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.lists[key] = {
|
||||
key: key,
|
||||
requestedAt: new Date(),
|
||||
deleteTimer: null,
|
||||
list: []
|
||||
};
|
||||
};
|
||||
|
||||
ListCache.prototype.insertListData = function(ircObject, message) {
|
||||
var key = ircObject.key;
|
||||
if (key !== '' && !this.lists[key]) {
|
||||
this.createList(key);
|
||||
}
|
||||
|
||||
this.lists[key].list.push({
|
||||
channel: message.params[1],
|
||||
users: message.params[2],
|
||||
topic: message.params[3],
|
||||
raw: message.raw
|
||||
});
|
||||
};
|
||||
// ========================================
|
||||
|
||||
exports.ListCache = new ListCache();
|
@ -1,65 +0,0 @@
|
||||
var pausequeue = require('pause-queue'),
|
||||
_ = require('lodash'),
|
||||
api = require(__dirname + '/api').Api,
|
||||
Queues = {};
|
||||
|
||||
function QueuePool() {
|
||||
|
||||
};
|
||||
|
||||
// ========================================
|
||||
// these functions provide a way to push a new client into the queue, this means
|
||||
// we can send 1000 clients to boot up, but in the old code they would do it at once
|
||||
// which just wouldn't work, we now queue it with time in between.
|
||||
|
||||
QueuePool.prototype.queueJob = function(server, qid, key, fn) {
|
||||
var queue = this.queueExists(server);
|
||||
|
||||
queue.push({key: key, qid: qid}, fn);
|
||||
// here we take the server hostname, just directly so irc.freenode.org and chat.freenode.org
|
||||
// are different. We have individual queues for hostnames so we can pause that queue if we've
|
||||
// hit the throttling limit for that server or network
|
||||
};
|
||||
|
||||
QueuePool.prototype.queueExists = function(server) {
|
||||
server = server.toLowerCase();
|
||||
|
||||
if (!Queues[server]) {
|
||||
Queues[server] = pausequeue(function(task, done) {
|
||||
setTimeout(done, 1000);
|
||||
// we don't get to the next item until we wait 1.5 seconds
|
||||
}, 1);
|
||||
}
|
||||
|
||||
return Queues[server];
|
||||
// checks if a queue exists, creates or returns an existing queue
|
||||
};
|
||||
|
||||
QueuePool.prototype.queueLength = function(server) {
|
||||
return this.queueExists(server).length() + 1;
|
||||
};
|
||||
|
||||
QueuePool.prototype.queuePause = function(server) {
|
||||
var queue = this.queueExists(server);
|
||||
|
||||
if (!queue.paused) {
|
||||
queue.pause();
|
||||
// pause the queue
|
||||
|
||||
setTimeout(function() {
|
||||
queue.tasks = _.sortBy(queue.tasks, function(task) {
|
||||
return task.data.qid;
|
||||
});
|
||||
// make sure its re-sorted via the time of insert
|
||||
|
||||
queue.resume();
|
||||
}, 30000);
|
||||
// attempt to try and start again in 30 seconds
|
||||
// generally we've no idea how long the servers throttle wait is, default is 60
|
||||
// but incase of it being less we can just try 30, that way if it is something like
|
||||
// 30 we're not losing 30 seconds of potential reconnect time
|
||||
}
|
||||
};
|
||||
// ========================================
|
||||
|
||||
exports.QueuePool = new QueuePool();
|
@ -1,33 +1,33 @@
|
||||
import { cfg, read } from './cfg.js';
|
||||
import { loadEvents } from './lib.js';
|
||||
|
||||
//const TelegramBot = require('node-telegram-bot-api');
|
||||
const safeEval = require('safe-eval');
|
||||
let irclib = require('./irc/irc.js');
|
||||
//const safeEval = require('safe-eval');
|
||||
const util = require('util');
|
||||
const fs = require('fs');
|
||||
const ytdl = util.promisify(require('youtube-dl').getInfo);
|
||||
//const fs = require('fs');
|
||||
//const ytdl = util.promisify(require('youtube-dl').getInfo);
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
let irc = (new (require(`${__dirname}/irc/api`)).Api()).connect({
|
||||
events: 31920,
|
||||
rpc: 31930,
|
||||
automaticSetup: true
|
||||
});
|
||||
|
||||
const wrapper = function() {
|
||||
//loadIRC();
|
||||
//loadEvents();
|
||||
//rpc.emit('call', 'n0xy', 'privmsg', [ '#kbot-dev', 'blah' ]);
|
||||
let irc = new irclib({
|
||||
network: "n0xy",
|
||||
host: "31.172.14.83",
|
||||
port: 6669, //6669,
|
||||
ssl: true,
|
||||
selfSigned: true,
|
||||
nickname: "kbotv3",
|
||||
username: "kbotv2/n0xy",
|
||||
password: "blah",
|
||||
realname: "kbotv3",
|
||||
channels: [
|
||||
"#kbot-dev"
|
||||
]
|
||||
});
|
||||
|
||||
//const tg = new (require('node-telegram-bot-api'))('381368731:AAFalG-LknIbtBDuOvRXcxHUEK9Jg_o1UCw', { polling: true });
|
||||
|
||||
for(let srv in cfg.irc) {
|
||||
irc.rpc.emit('createClient', srv, cfg.irc[srv]);
|
||||
console.log('Loading server', srv);
|
||||
}
|
||||
console.log('All servers have been loaded successfully');
|
||||
|
||||
const tg = new (require('node-telegram-bot-api'))('381368731:AAFalG-LknIbtBDuOvRXcxHUEK9Jg_o1UCw', { polling: true });
|
||||
|
||||
irc.events.on('message', msg => {
|
||||
irc.on("message", (msg) => {
|
||||
this.emit('message', msg);
|
||||
//if( msg.event[1] === "privmsg" ) {
|
||||
// let e = reply( msg );
|
||||
@ -35,37 +35,14 @@ const wrapper = function() {
|
||||
//}
|
||||
});
|
||||
|
||||
tg.on('message', msg => {
|
||||
/*tg.on('message', msg => {
|
||||
this.emit('message', msg);
|
||||
//let e = replytg(tg, msg);
|
||||
//console.log( `TG: (${e.time}) ${e.channel} -> ${e.user.nick}: ${e.message}` );
|
||||
});
|
||||
});*/
|
||||
|
||||
};
|
||||
|
||||
|
||||
const reply = tmp => {
|
||||
return {
|
||||
network: tmp.event[0],
|
||||
channel: tmp.message.target,
|
||||
user: {
|
||||
nick: tmp.message.nickname,
|
||||
username: tmp.message.username,
|
||||
hostname: tmp.message.hostname
|
||||
},
|
||||
message: tmp.message.message,
|
||||
time: tmp.message.time,
|
||||
reply: msg => {
|
||||
rpc.emit('call', this.network, 'privmsg', [ this.channel, msg ]);
|
||||
},
|
||||
replyAction: msg => {
|
||||
rpc.emit('call', this.network, 'privmsg', [ this.channel, '\u0001' + 'ACTION ' + msg + '\u0001' ]);
|
||||
},
|
||||
replyNotice: msg => {
|
||||
rpc.emit('call', this.network, 'notice', [ this.channel, msg ]);
|
||||
}
|
||||
};
|
||||
};
|
||||
const replytg = (bot, tmp) => {
|
||||
return {
|
||||
channel: tmp.chat.title,
|
||||
|
Loading…
Reference in New Issue
Block a user