From a0429d2883c263f6ec54c5374128670fc77a5abb Mon Sep 17 00:00:00 2001 From: Amaury Joly Date: Tue, 4 May 2021 21:29:44 +0200 Subject: [PATCH] init --- config.json | 5 + package-lock.json | 1512 +++++++++++++++++++++++++++++++++++++++ package.json | 15 + save/722815725474938890 | Bin 0 -> 12288 bytes save/824967889626988584 | Bin 0 -> 12288 bytes save/prop.json | 15 + save/tmp.db | Bin 0 -> 53248 bytes src/index.ts | 99 +++ src/show.ts | 26 + tsconfig.json | 7 + 10 files changed, 1679 insertions(+) create mode 100644 config.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 save/722815725474938890 create mode 100644 save/824967889626988584 create mode 100644 save/prop.json create mode 100644 save/tmp.db create mode 100644 src/index.ts create mode 100644 src/show.ts create mode 100644 tsconfig.json 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 0000000000000000000000000000000000000000..e908272f01614aaed172cd086f12f7dc2d2b0eab GIT binary patch literal 12288 zcmeI#O-sWt7zgllippRww;hJ;xorcHjh%hzX4J7dwRYeTDb;3B>{@Ly@Gkhx{1AQ< zkG5m$X`|r5!}vdtG)enFo?m*&-L2s%L6b0=I*K~1%ruRi5;4ZKxNXI48OeNmIfvy{5+E?oK8I9 zyNir7ey)!Ui|P-L^~`kTO@$wZuhbt}{DPab%Kws*;UgGRdP<0EP{SHd*gxt$8HY0L{;@h;!|_(pF#GZoI~@n#nX zXSdT~a_Wp<<4mS}N>5 z=r`-3*WUI`cC1p8^pfDQ!`R^e(8H4K2hz{J$e%yC%19a|={PX7!(K4X**hY}m}7Iz z<~+FVtj`DbIvr<)!y0dY<_f=MoYU%xcLc_bsHjf`cg7agbLiMB7uZ|}Q;7So%wB&thiiGnaprPkz&FFtiY*zCD( zeZ|9Hue3?VBPFA7R&gK>+dbE(N`FwvEH`Q_qa>Noan~2`g-7%1omMNeI102G%Gjhz z>S3hfZ-26akKXZV+dHEZaYohI)@!SF+c^@Qlj>s8dvB;!TMAR#cAl0*nKKoK^1Hr_ z?1_FDT$$uyY!^Fwal`FJcY3aWHvOVCJf3Ruy#S3@LHUtD9009U< c00Izz00bZa0SG_<0{@M`tF_?y@Ban32geztz5oCK literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..13233a407c6759abda9cb54a8589bcbbfdbcfd35 GIT binary patch literal 53248 zcmeHw+mGYum0$PRUhjHiPyDnGM&Mq**hZ|WZeGNh1vUvO-o=|Jilk^521{a9sY^HO zQr$IAy9tngC(ro<@*E(*KIA=rM1UYce&-`uMX7s+8e?OR9gb1%x~NKr=R5cFJLemZ zoW-Gdb+g&6^200s#lL*<^5u(v_v+P)7cc%6A3wy$zre?L@$sGNU;M-Vds%<-HUIwY zi_iY;fB)g9|MSHsKl;gwA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^T8?f< zMrP@Ja=~Q>Cl>AwQ_BnBXsfMg&j8FlRtaI#Bn&QFc|}m)8k5=Jh3NE6YwXBgY+AM) zYIj|bv`(c z8=fHISOK-dCMfKmhhO?|Tk84MM2%DQr8JX8-QpBE$OfV{(oJ*FkJJn9Nv`)J!xICG z31lO}{-=mD=m`-^P{rCTA(P2%hiH)!PS zBvcJoPGjAnO>ed%Pc$n^)OIswlplcLd`)mX5B=6$sf1bxr)PtaPF=jED3d8b)}JBr{s-YAMf zTNx>a*$-Vw$y`~#U`2El*p{&u;#C+&5@+lxqt$*0NU`&VmdIe25jaOC40}<5`GsWR z?hv|K51t3XExR^^czLL{Jm3l6Lt`sfbYh@j&Gk&O`jdE|@$Lkd#Acytn!0|0Y<*a3 zVf%)#NrpBj;`mk@pr#MK`^P2rRn+^_S&*Gyvl#mc?2H{24IT=?RJEoEa(s7nZvkf3OBgr3BaOSTK&HIntK3uxtH$mKyTLw|IcVF` zF8KP^Ffi!sHX_N^2Lqo^(@b%BcN~r!48`=Vsn>3=Dp|9A^qpZV%Vrg1=KgV0UJQ@p zJLJXvJGjOTsRS+SW(Jk@fYAU(^%3jJPK3!71c}qeyqM{cXyShC;V2$+nsdoz@|B@# z+`ohOfXAuVD++dyGiVzIz@|O7;p8#KtM}xb7p4=T*AKNnF zdeTTyw8X=0DZCj>RE^^jA&ry^_{Sm(ye;$;R7lcQxv=`_JBQ5{j%bcOqO@fDdb7bo zQQAq(wpPC<)uDZg5CK}^QeIt5vdFIYZm5E$2~M1i!@iLH75Iixq LSVKjZXdeGB-U~v@ literal 0 HcmV?d00001 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