commit a0429d2883c263f6ec54c5374128670fc77a5abb Author: Amaury Joly Date: Tue May 4 21:29:44 2021 +0200 init diff --git a/config.json b/config.json new file mode 100644 index 0000000..b3a7780 --- /dev/null +++ b/config.json @@ -0,0 +1,5 @@ +{ + "discord": { + "token": "vide il faut insérer votre token ici" + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..178fc3c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1512 @@ +{ + "name": "test-listener", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "discord.js": "^12.5.3", + "gestion-listener": "file:../gestion-listener" + }, + "devDependencies": { + "@tsconfig/node10": "^1.0.7", + "@types/node": "^14.14.37", + "typescript": "^4.2.4" + } + }, + "../gestion-listener": { + "version": "1.0.0", + "bundleDependencies": [ + "@databases/sqlite", + "@types/node", + "listener-rss" + ], + "license": "MIT", + "dependencies": { + "@databases/sqlite": "^3.0.0", + "listener-rss": "^0.0.1" + }, + "devDependencies": { + "@types/chai": "^4.2.15", + "@types/mocha": "^8.2.1", + "@types/node": "14.14.37", + "@typescript-eslint/eslint-plugin": "4.19.0", + "@typescript-eslint/parser": "4.19.0", + "chai": "4.3.3", + "cross-env": "^7.0.3", + "eslint": "^7.21.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-mocha": "8.0.0", + "eslint-plugin-prettier": "3.3.1", + "mocha": "^8.2.1", + "nock": "^13.0.11", + "prettier": "2.2.1", + "sinon-chai": "^3.5.0", + "tmp-promise": "^3.0.2", + "ts-node": "9.1.1", + "ts-sinon": "2.0.1", + "typescript": "^4.1.3" + } + }, + "../gestion-listener/node_modules/@databases/escape-identifier": { + "version": "1.0.1", + "inBundle": true, + "dependencies": { + "@databases/validate-unicode": "1.0.0" + } + }, + "../gestion-listener/node_modules/@databases/sql": { + "version": "3.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/@databases/sqlite": { + "version": "3.0.0", + "inBundle": true, + "dependencies": { + "@databases/escape-identifier": "1.0.1", + "@databases/sql": "3.0.0", + "@types/sqlite3": "3.1.7", + "sqlite3": "4.2.0", + "then-queue": "1.3.0" + } + }, + "../gestion-listener/node_modules/@databases/validate-unicode": { + "version": "1.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/@types/node": { + "version": "14.14.41", + "inBundle": true + }, + "../gestion-listener/node_modules/@types/sqlite3": { + "version": "3.1.7", + "inBundle": true, + "dependencies": { + "@types/node": "14.14.41" + } + }, + "../gestion-listener/node_modules/abbrev": { + "version": "1.1.1", + "inBundle": true + }, + "../gestion-listener/node_modules/ansi-regex": { + "version": "2.1.1", + "inBundle": true, + "engines": { + "node": ">=8" + } + }, + "../gestion-listener/node_modules/aproba": { + "version": "1.2.0", + "inBundle": true + }, + "../gestion-listener/node_modules/are-we-there-yet": { + "version": "1.1.5", + "inBundle": true, + "dependencies": { + "delegates": "1.0.0", + "readable-stream": "2.3.7" + } + }, + "../gestion-listener/node_modules/asap": { + "version": "1.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/balanced-match": { + "version": "1.0.2", + "inBundle": true + }, + "../gestion-listener/node_modules/brace-expansion": { + "version": "1.1.11", + "inBundle": true, + "dependencies": { + "balanced-match": "1.0.2", + "concat-map": "0.0.1" + } + }, + "../gestion-listener/node_modules/chownr": { + "version": "1.1.4", + "inBundle": true + }, + "../gestion-listener/node_modules/code-point-at": { + "version": "1.1.0", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/concat-map": { + "version": "0.0.1", + "inBundle": true + }, + "../gestion-listener/node_modules/console-control-strings": { + "version": "1.1.0", + "inBundle": true + }, + "../gestion-listener/node_modules/core-util-is": { + "version": "1.0.2", + "inBundle": true + }, + "../gestion-listener/node_modules/debug": { + "version": "3.2.7", + "inBundle": true, + "dependencies": { + "ms": "2.1.3" + }, + "engines": { + "node": ">=6.0" + } + }, + "../gestion-listener/node_modules/deep-extend": { + "version": "0.6.0", + "inBundle": true, + "engines": { + "node": ">=4.0.0" + } + }, + "../gestion-listener/node_modules/delegates": { + "version": "1.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/detect-libc": { + "version": "1.0.3", + "inBundle": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "../gestion-listener/node_modules/entities": { + "version": "2.2.0", + "inBundle": true + }, + "../gestion-listener/node_modules/fs-minipass": { + "version": "1.2.7", + "inBundle": true, + "dependencies": { + "minipass": "2.9.0" + } + }, + "../gestion-listener/node_modules/fs.realpath": { + "version": "1.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/gauge": { + "version": "2.7.4", + "inBundle": true, + "dependencies": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.3", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.3" + } + }, + "../gestion-listener/node_modules/glob": { + "version": "7.1.6", + "inBundle": true, + "dependencies": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + }, + "engines": { + "node": "*" + } + }, + "../gestion-listener/node_modules/has-unicode": { + "version": "2.0.1", + "inBundle": true + }, + "../gestion-listener/node_modules/iconv-lite": { + "version": "0.4.24", + "inBundle": true, + "dependencies": { + "safer-buffer": "2.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/ignore-walk": { + "version": "3.0.3", + "inBundle": true, + "dependencies": { + "minimatch": "3.0.4" + } + }, + "../gestion-listener/node_modules/inflight": { + "version": "1.0.6", + "inBundle": true, + "dependencies": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "../gestion-listener/node_modules/inherits": { + "version": "2.0.4", + "inBundle": true + }, + "../gestion-listener/node_modules/ini": { + "version": "1.3.8", + "inBundle": true + }, + "../gestion-listener/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "inBundle": true, + "dependencies": { + "number-is-nan": "1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/isarray": { + "version": "1.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/listener-rss": { + "version": "0.0.1", + "inBundle": true, + "dependencies": { + "rss-parser": "3.11.0" + } + }, + "../gestion-listener/node_modules/minimatch": { + "version": "3.0.4", + "inBundle": true, + "dependencies": { + "brace-expansion": "1.1.11" + }, + "engines": { + "node": "*" + } + }, + "../gestion-listener/node_modules/minimist": { + "version": "1.2.5", + "inBundle": true + }, + "../gestion-listener/node_modules/minipass": { + "version": "2.9.0", + "inBundle": true, + "dependencies": { + "safe-buffer": "5.1.2", + "yallist": "3.1.1" + } + }, + "../gestion-listener/node_modules/minizlib": { + "version": "1.3.3", + "inBundle": true, + "dependencies": { + "minipass": "2.9.0" + } + }, + "../gestion-listener/node_modules/mkdirp": { + "version": "0.5.5", + "inBundle": true, + "dependencies": { + "minimist": "1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "../gestion-listener/node_modules/ms": { + "version": "2.1.3", + "inBundle": true + }, + "../gestion-listener/node_modules/nan": { + "version": "2.14.2", + "inBundle": true + }, + "../gestion-listener/node_modules/needle": { + "version": "2.6.0", + "inBundle": true, + "dependencies": { + "debug": "3.2.7", + "iconv-lite": "0.4.24", + "sax": "1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "../gestion-listener/node_modules/node-pre-gyp": { + "version": "0.11.0", + "inBundle": true, + "dependencies": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.5", + "needle": "2.6.0", + "nopt": "4.0.3", + "npm-packlist": "1.4.8", + "npmlog": "4.1.2", + "rc": "1.2.8", + "rimraf": "2.7.1", + "semver": "5.7.1", + "tar": "4.4.13" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "../gestion-listener/node_modules/nopt": { + "version": "4.0.3", + "inBundle": true, + "dependencies": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "../gestion-listener/node_modules/npm-bundled": { + "version": "1.1.1", + "inBundle": true, + "dependencies": { + "npm-normalize-package-bin": "1.0.1" + } + }, + "../gestion-listener/node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "inBundle": true + }, + "../gestion-listener/node_modules/npm-packlist": { + "version": "1.4.8", + "inBundle": true, + "dependencies": { + "ignore-walk": "3.0.3", + "npm-bundled": "1.1.1", + "npm-normalize-package-bin": "1.0.1" + } + }, + "../gestion-listener/node_modules/npmlog": { + "version": "4.1.2", + "inBundle": true, + "dependencies": { + "are-we-there-yet": "1.1.5", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "../gestion-listener/node_modules/number-is-nan": { + "version": "1.0.1", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/object-assign": { + "version": "4.1.1", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/once": { + "version": "1.4.0", + "inBundle": true, + "dependencies": { + "wrappy": "1.0.2" + } + }, + "../gestion-listener/node_modules/os-homedir": { + "version": "1.0.2", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/os-tmpdir": { + "version": "1.0.2", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/osenv": { + "version": "0.1.5", + "inBundle": true, + "dependencies": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "../gestion-listener/node_modules/path-is-absolute": { + "version": "1.0.1", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/process-nextick-args": { + "version": "2.0.1", + "inBundle": true + }, + "../gestion-listener/node_modules/promise": { + "version": "6.1.0", + "inBundle": true, + "dependencies": { + "asap": "1.0.0" + } + }, + "../gestion-listener/node_modules/rc": { + "version": "1.2.8", + "inBundle": true, + "dependencies": { + "deep-extend": "0.6.0", + "ini": "1.3.8", + "minimist": "1.2.5", + "strip-json-comments": "2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "../gestion-listener/node_modules/readable-stream": { + "version": "2.3.7", + "inBundle": true, + "dependencies": { + "core-util-is": "1.0.2", + "inherits": "2.0.4", + "isarray": "1.0.0", + "process-nextick-args": "2.0.1", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "../gestion-listener/node_modules/rimraf": { + "version": "2.7.1", + "inBundle": true, + "dependencies": { + "glob": "7.1.6" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "../gestion-listener/node_modules/rss-parser": { + "version": "3.11.0", + "inBundle": true, + "dependencies": { + "entities": "2.2.0", + "xml2js": "0.4.23" + } + }, + "../gestion-listener/node_modules/safe-buffer": { + "version": "5.1.2", + "inBundle": true + }, + "../gestion-listener/node_modules/safer-buffer": { + "version": "2.1.2", + "inBundle": true + }, + "../gestion-listener/node_modules/sax": { + "version": "1.2.4", + "inBundle": true + }, + "../gestion-listener/node_modules/semver": { + "version": "5.7.1", + "inBundle": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "../gestion-listener/node_modules/set-blocking": { + "version": "2.0.0", + "inBundle": true + }, + "../gestion-listener/node_modules/signal-exit": { + "version": "3.0.3", + "inBundle": true + }, + "../gestion-listener/node_modules/sqlite3": { + "version": "4.2.0", + "inBundle": true, + "dependencies": { + "nan": "2.14.2", + "node-pre-gyp": "0.11.0" + } + }, + "../gestion-listener/node_modules/string_decoder": { + "version": "1.1.1", + "inBundle": true, + "dependencies": { + "safe-buffer": "5.1.2" + } + }, + "../gestion-listener/node_modules/string-width": { + "version": "1.0.2", + "inBundle": true, + "dependencies": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "../gestion-listener/node_modules/strip-ansi": { + "version": "3.0.1", + "inBundle": true, + "dependencies": { + "ansi-regex": "2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "../gestion-listener/node_modules/strip-json-comments": { + "version": "2.0.1", + "inBundle": true, + "engines": { + "node": ">=8" + } + }, + "../gestion-listener/node_modules/tar": { + "version": "4.4.13", + "inBundle": true, + "dependencies": { + "chownr": "1.1.4", + "fs-minipass": "1.2.7", + "minipass": "2.9.0", + "minizlib": "1.3.3", + "mkdirp": "0.5.5", + "safe-buffer": "5.1.2", + "yallist": "3.1.1" + }, + "engines": { + "node": ">=4.5" + } + }, + "../gestion-listener/node_modules/then-queue": { + "version": "1.3.0", + "inBundle": true, + "dependencies": { + "promise": "6.1.0" + } + }, + "../gestion-listener/node_modules/util-deprecate": { + "version": "1.0.2", + "inBundle": true + }, + "../gestion-listener/node_modules/wide-align": { + "version": "1.1.3", + "inBundle": true, + "dependencies": { + "string-width": "1.0.2" + } + }, + "../gestion-listener/node_modules/wrappy": { + "version": "1.0.2", + "inBundle": true + }, + "../gestion-listener/node_modules/xml2js": { + "version": "0.4.23", + "inBundle": true, + "dependencies": { + "sax": "1.2.4", + "xmlbuilder": "11.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "../gestion-listener/node_modules/xmlbuilder": { + "version": "11.0.1", + "inBundle": true, + "engines": { + "node": ">=4.0" + } + }, + "../gestion-listener/node_modules/yallist": { + "version": "3.1.1", + "inBundle": true + }, + "../listener-rss": { + "version": "0.0.2", + "bundleDependencies": [ + "@types/chai", + "@types/mocha", + "@types/node", + "@typescript-eslint/eslint-plugin", + "@typescript-eslint/parser", + "chai", + "eslint", + "eslint-config-airbnb-base", + "eslint-config-prettier", + "eslint-plugin-import", + "eslint-plugin-mocha", + "eslint-plugin-prettier", + "mocha", + "prettier", + "proxyquire", + "rss-parser", + "sinon-chai", + "ts-mock-imports", + "ts-node", + "ts-sinon", + "tsc-watch", + "typescript" + ], + "extraneous": true, + "license": "MIT", + "dependencies": { + "rss-parser": "3.11.0" + }, + "devDependencies": { + "@types/chai": "^4.2.14", + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.25", + "@typescript-eslint/eslint-plugin": "^4.14.2", + "@typescript-eslint/parser": "^4.14.2", + "chai": "4.3.0", + "eslint": "^7.19.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "7.2.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-mocha": "8.0.0", + "eslint-plugin-prettier": "3.3.1", + "mocha": "8.2.1", + "prettier": "2.2.1", + "proxyquire": "2.1.3", + "sinon-chai": "3.5.0", + "ts-mock-imports": "1.3.3", + "ts-node": "9.1.1", + "ts-sinon": "2.0.1", + "tsc-watch": "^4.2.9", + "typescript": "^4.1.3" + } + }, + "node_modules/@discordjs/collection": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", + "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + }, + "node_modules/@discordjs/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "dependencies": { + "asynckit": "0.4.0", + "combined-stream": "1.0.8", + "mime-types": "2.1.30" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.7.tgz", + "integrity": "sha512-aBvUmXLQbayM4w3A8TrjwrXs4DZ8iduJnuJLLRGdkWlyakCf1q6uHZJBzXoRA/huAEknG5tcUyQxN3A+In5euQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "5.0.1" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/discord.js": { + "version": "12.5.3", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", + "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", + "dependencies": { + "@discordjs/collection": "0.1.6", + "@discordjs/form-data": "3.0.1", + "abort-controller": "3.0.0", + "node-fetch": "2.6.1", + "prism-media": "1.2.9", + "setimmediate": "1.0.5", + "tweetnacl": "1.0.3", + "ws": "7.4.5" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/gestion-listener": { + "resolved": "../gestion-listener", + "link": true + }, + "node_modules/mime-db": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "dependencies": { + "mime-db": "1.47.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/prism-media": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.9.tgz", + "integrity": "sha512-UHCYuqHipbTR1ZsXr5eg4JUmHER8Ss4YEb9Azn+9zzJ7/jlTtD1h0lc4g6tNx3eMlB8Mp6bfll0LPMAV4R6r3Q==" + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "node_modules/typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/ws": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", + "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==", + "engines": { + "node": ">=8.3.0" + } + } + }, + "dependencies": { + "@discordjs/collection": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", + "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + }, + "@discordjs/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.8", + "mime-types": "2.1.30" + } + }, + "@tsconfig/node10": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.7.tgz", + "integrity": "sha512-aBvUmXLQbayM4w3A8TrjwrXs4DZ8iduJnuJLLRGdkWlyakCf1q6uHZJBzXoRA/huAEknG5tcUyQxN3A+In5euQ==", + "dev": true + }, + "@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "5.0.1" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "discord.js": { + "version": "12.5.3", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", + "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", + "requires": { + "@discordjs/collection": "0.1.6", + "@discordjs/form-data": "3.0.1", + "abort-controller": "3.0.0", + "node-fetch": "2.6.1", + "prism-media": "1.2.9", + "setimmediate": "1.0.5", + "tweetnacl": "1.0.3", + "ws": "7.4.5" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "gestion-listener": { + "version": "file:../gestion-listener", + "requires": { + "@databases/sqlite": "^3.0.0", + "@types/chai": "^4.2.15", + "@types/mocha": "^8.2.1", + "@types/node": "14.14.37", + "@typescript-eslint/eslint-plugin": "4.19.0", + "@typescript-eslint/parser": "4.19.0", + "chai": "4.3.3", + "cross-env": "^7.0.3", + "eslint": "^7.21.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-mocha": "8.0.0", + "eslint-plugin-prettier": "3.3.1", + "listener-rss": "^0.0.1", + "mocha": "^8.2.1", + "nock": "^13.0.11", + "prettier": "2.2.1", + "sinon-chai": "^3.5.0", + "tmp-promise": "^3.0.2", + "ts-node": "9.1.1", + "ts-sinon": "2.0.1", + "typescript": "^4.1.3" + }, + "dependencies": { + "@databases/escape-identifier": { + "version": "1.0.1", + "bundled": true, + "requires": { + "@databases/validate-unicode": "1.0.0" + } + }, + "@databases/sql": { + "version": "3.0.0", + "bundled": true + }, + "@databases/sqlite": { + "version": "3.0.0", + "bundled": true, + "requires": { + "@databases/escape-identifier": "1.0.1", + "@databases/sql": "3.0.0", + "@types/sqlite3": "3.1.7", + "sqlite3": "4.2.0", + "then-queue": "1.3.0" + } + }, + "@databases/validate-unicode": { + "version": "1.0.0", + "bundled": true + }, + "@types/node": { + "version": "14.14.41", + "bundled": true + }, + "@types/sqlite3": { + "version": "3.1.7", + "bundled": true, + "requires": { + "@types/node": "14.14.41" + } + }, + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.7" + } + }, + "asap": { + "version": "1.0.0", + "bundled": true + }, + "balanced-match": { + "version": "1.0.2", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "1.0.2", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.4", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "debug": { + "version": "3.2.7", + "bundled": true, + "requires": { + "ms": "2.1.3" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true + }, + "entities": { + "version": "2.2.0", + "bundled": true + }, + "fs-minipass": { + "version": "1.2.7", + "bundled": true, + "requires": { + "minipass": "2.9.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.3", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.3" + } + }, + "glob": { + "version": "7.1.6", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.4", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.3", + "bundled": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true + }, + "ini": { + "version": "1.3.8", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "listener-rss": { + "version": "0.0.1", + "bundled": true, + "requires": { + "rss-parser": "3.11.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.5", + "bundled": true + }, + "minipass": { + "version": "2.9.0", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2", + "yallist": "3.1.1" + } + }, + "minizlib": { + "version": "1.3.3", + "bundled": true, + "requires": { + "minipass": "2.9.0" + } + }, + "mkdirp": { + "version": "0.5.5", + "bundled": true, + "requires": { + "minimist": "1.2.5" + } + }, + "ms": { + "version": "2.1.3", + "bundled": true + }, + "nan": { + "version": "2.14.2", + "bundled": true + }, + "needle": { + "version": "2.6.0", + "bundled": true, + "requires": { + "debug": "3.2.7", + "iconv-lite": "0.4.24", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.11.0", + "bundled": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.5", + "needle": "2.6.0", + "nopt": "4.0.3", + "npm-packlist": "1.4.8", + "npmlog": "4.1.2", + "rc": "1.2.8", + "rimraf": "2.7.1", + "semver": "5.7.1", + "tar": "4.4.13" + } + }, + "nopt": { + "version": "4.0.3", + "bundled": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.1.1", + "bundled": true, + "requires": { + "npm-normalize-package-bin": "1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "bundled": true + }, + "npm-packlist": { + "version": "1.4.8", + "bundled": true, + "requires": { + "ignore-walk": "3.0.3", + "npm-bundled": "1.1.1", + "npm-normalize-package-bin": "1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "1.1.5", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true + }, + "promise": { + "version": "6.1.0", + "bundled": true, + "requires": { + "asap": "1.0.0" + } + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "requires": { + "deep-extend": "0.6.0", + "ini": "1.3.8", + "minimist": "1.2.5", + "strip-json-comments": "2.0.1" + } + }, + "readable-stream": { + "version": "2.3.7", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.4", + "isarray": "1.0.0", + "process-nextick-args": "2.0.1", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.7.1", + "bundled": true, + "requires": { + "glob": "7.1.6" + } + }, + "rss-parser": { + "version": "3.11.0", + "bundled": true, + "requires": { + "entities": "2.2.0", + "xml2js": "0.4.23" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "5.7.1", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.3", + "bundled": true + }, + "sqlite3": { + "version": "4.2.0", + "bundled": true, + "requires": { + "nan": "2.14.2", + "node-pre-gyp": "0.11.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "4.4.13", + "bundled": true, + "requires": { + "chownr": "1.1.4", + "fs-minipass": "1.2.7", + "minipass": "2.9.0", + "minizlib": "1.3.3", + "mkdirp": "0.5.5", + "safe-buffer": "5.1.2", + "yallist": "3.1.1" + } + }, + "then-queue": { + "version": "1.3.0", + "bundled": true, + "requires": { + "promise": "6.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "xml2js": { + "version": "0.4.23", + "bundled": true, + "requires": { + "sax": "1.2.4", + "xmlbuilder": "11.0.1" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "bundled": true + }, + "yallist": { + "version": "3.1.1", + "bundled": true + } + } + }, + "mime-db": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" + }, + "mime-types": { + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "requires": { + "mime-db": "1.47.0" + } + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "prism-media": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.9.tgz", + "integrity": "sha512-UHCYuqHipbTR1ZsXr5eg4JUmHER8Ss4YEb9Azn+9zzJ7/jlTtD1h0lc4g6tNx3eMlB8Mp6bfll0LPMAV4R6r3Q==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true + }, + "ws": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", + "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3fc26c5 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "main": "src/index.js", + "scripts": { + "start": "ts-node src/index.ts" + }, + "dependencies": { + "discord.js": "^12.5.3", + "gestion-listener": "file:../gestion-listener" + }, + "devDependencies": { + "@tsconfig/node10": "^1.0.7", + "@types/node": "^14.14.37", + "typescript": "^4.2.4" + } +} diff --git a/save/722815725474938890 b/save/722815725474938890 new file mode 100644 index 0000000..e908272 Binary files /dev/null and b/save/722815725474938890 differ diff --git a/save/824967889626988584 b/save/824967889626988584 new file mode 100644 index 0000000..d2ec871 Binary files /dev/null and b/save/824967889626988584 differ diff --git a/save/prop.json b/save/prop.json new file mode 100644 index 0000000..08c4200 --- /dev/null +++ b/save/prop.json @@ -0,0 +1,15 @@ +[ + { + "address":"https://feeds.leparisien.fr/leparisien/rss", + "timeloop": 30 + }, + { + "address":"https://www.ledauphine.com/rss", + "timeloop": 30 + }, + { + "address":"https://tomuss.univ-lyon1.fr/S/2021/Printemps/rss/dcd1262cd88a3c2", + "timeloop": 30 + } + +] \ No newline at end of file diff --git a/save/tmp.db b/save/tmp.db new file mode 100644 index 0000000..13233a4 Binary files /dev/null and b/save/tmp.db differ diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..533f36f --- /dev/null +++ b/src/index.ts @@ -0,0 +1,99 @@ +import { ManageListener } from "gestion-listener" +import { Client, DMChannel, Message, NewsChannel, TextChannel } from "discord.js" + +import {show} from "./show" +const path = require("path"); + +import { openSync } from "fs" + +const config: {'discord': {'token': string}} = require('../config.json') + +// setup Discord +const monClient = new Client(); +let channel_on: Array = []; + +// setup gestion listener +let mesMl: {ml: ManageListener, channel: TextChannel | NewsChannel | DMChannel}[] = []; +// const ml = new ManageListener(path.join(__dirname, '../save/tmp.db')); + +const fun_rss = async (message: Message, args: string[], ml: ManageListener) : Promise => { + switch(args[0]) { + case 'start': + channel_on.push(message.channel); + await ml.startAll(); + console.log(`Demarrage du service sur ${message.channel.toString()}`); + message.channel.send('Le feed va bientôt apparaitre 😉'); + break; + case 'stop': + channel_on.splice(channel_on.indexOf(message.channel)); + await ml.stopAll(); + console.log(`Arret du service sur #${message.channel.toString()}`); + message.channel.send('Le feed a bien été retiré 🤐'); + break; + case 'add': + if(args[1]) { + ml.registerListener({ + address: args[1] + }); + message.channel.send(`Ajout du service correspondant au lien : ${args[1]} 👌`); + } + else message.channel.send(`L'argument doit etre un lien vers un flux rss valide`) + break; + case 'help': + default: + // console.log(show.show_rss_help()); + message.channel.send(show.show_rss_help()); + break; + } +} + +const init_ml = async (message: Message) : Promise => { + const new_path = path.join(__dirname, `../save/${message.channel.id}`); + openSync(new_path, 'w'); + const new_ml = new ManageListener(new_path); + mesMl.push({ + ml: new_ml, + channel: message.channel + }); + + new_ml.on("newEntries", async (obj) => { + if (obj) { + obj.map((item: any) => `${item.link}\n\t${item.title} :: Le ${(new Date()).toLocaleTimeString()}\n`) + .forEach((item: string) => { + // console.log(`${item}\n`); + message.channel.send(`${item}\n`); + } + ) + } + await new_ml.save(); + }); + + await new_ml.load(); + + return new_ml; +} + +monClient.on('message', async (message) => { + const splited_message = message.content.split(' '); + if(splited_message[0] === "C2") { + const index_ml = mesMl.map(i => i.channel).indexOf(message.channel); + let ml: ManageListener; + if(!mesMl.map(i => i.channel).includes(message.channel)) + ml = await init_ml(message); + else + ml = mesMl[index_ml].ml; + switch(splited_message[1]) { + case 'rss': + await fun_rss(message, splited_message.slice(2), ml); + break; + case 'help': + default: + // console.log(show.show_help()); + message.channel.send(show.show_help()) + break; + } + } +}); +monClient.login(config.discord.token); + +console.log("Let's goooo"); diff --git a/src/show.ts b/src/show.ts new file mode 100644 index 0000000..3cd053b --- /dev/null +++ b/src/show.ts @@ -0,0 +1,26 @@ +const BOT_KEYWORD = 'C2'; + +export namespace show { + export function show_help(): string { + return `Voici la version 0.0.1 du script d'execution de skeptiCOM. Il prend en charge la version actuel du projet, c'est à dire un bot discord intéragissant avec des flux RSS et renvoyant periodiquement les nouvelles mises à jours de ce dernier. + +Pour utiliser le bot il faut appeller le mot clé "${BOT_KEYWORD}" suivie de l'action a réaliser + +Les actions réalisables sont les suivantes: +\`\`\` +- rss - permet de gerer les flux rss +- help - permet d'afficher ce message +\`\`\`` + } + export function show_rss_help(): string { + return `Voici la version 0.0.1 du script d'execution de skeptiCOM. Il prend en charge la version actuel du projet, c'est à dire un bot discord intéragissant avec des flux RSS et renvoyant periodiquement les nouvelles mises à jours de ce dernier. + +Les actions combinable avec le service rss sont : +\`\`\` +- start - permet de démarrer la lecture de flux dans le channel courant +- stop - permet d'arreter le flux dans ce channel +- add - permet d'ajouter un flux à la liste des flux suivies +- help - permet d'afficher ce message +\`\`\`` + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..398dab1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@tsconfig/node10/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "build" + } +} \ No newline at end of file