diff --git a/package-lock.json b/package-lock.json index f81dcd482..0ac27035d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,8 @@ "license": "MIT", "dependencies": { "@arcanebot/redis-sharder": "github:eduardozgz/redis-sharder", - "@twurple/api": "^5.0.1", - "@twurple/auth": "^5.0.1", + "@twurple/api": "^7.0.6", + "@twurple/auth": "^7.0.6", "bufferutil": "^4.0.1", "colorthief": "2.3.2", "cron": "^1.8.2", @@ -695,96 +695,43 @@ } }, "node_modules/@d-fischer/cache-decorators": { - "version": "3.0.0", - "integrity": "sha512-mYUCjrp5hJgimceC5bof3zzmElyxzW4ty+73IjY12wvxLAqsq0CbgLGspnJm6KgwEfGoeRnISZD4EXJidG3FvA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-4.0.1.tgz", + "integrity": "sha512-HNYLBLWs/t28GFZZeqdIBqq8f37mqDIFO6xNPof94VjpKvuP6ROqCZGafx88dk5zZUlBfViV9jD8iNNlXfc4CA==", "dependencies": { - "@d-fischer/shared-utils": "^3.0.1", - "@types/node": "^14.14.22", - "tslib": "^2.1.0" + "@d-fischer/shared-utils": "^3.6.3", + "tslib": "^2.6.2" } }, - "node_modules/@d-fischer/cache-decorators/node_modules/@types/node": { - "version": "14.17.21", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==" - }, "node_modules/@d-fischer/cross-fetch": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-4.1.0.tgz", - "integrity": "sha512-HH87JacceXOANr5XuBuSIQmPRPOvOUPwU1JR0DLUT6A8jGcP0jq2YUAiFCyZ8VGwDbTjsD3CZFpWIp5o7mIFWQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-5.0.5.tgz", + "integrity": "sha512-symjDUPInTrkfIsZc2n2mo9hiAJLcTJsZkNICjZajEWnWpJ3s3zn50/FY8xpNUAf5w3eFuQii2wxztTGpvG1Xg==", "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, - "node_modules/@d-fischer/cross-fetch/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/@d-fischer/cross-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/@d-fischer/cross-fetch/node_modules/webidl-conversions": { + "node_modules/@d-fischer/detect-node": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/@d-fischer/cross-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } + "resolved": "https://registry.npmjs.org/@d-fischer/detect-node/-/detect-node-3.0.1.tgz", + "integrity": "sha512-0Rf3XwTzuTh8+oPZW9SfxTIiL+26RRJ0BRPwj5oVjZFyFKmsj9RGfN2zuTRjOuA3FCK/jYm06HOhwNK+8Pfv8w==" }, "node_modules/@d-fischer/logger": { - "version": "4.1.1", - "integrity": "sha512-yQPteWFcO7+js+AxE/uO01gN4E6rxaePWLKnLAUT+0aFcaRq+kWWCoI5r2fa04jbadn9qUpSVxvK/YiC9cfVjw==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.3.tgz", + "integrity": "sha512-mJUx9OgjrNVLQa4od/+bqnmD164VTCKnK5B4WOW8TX5y/3w2i58p+PMRE45gUuFjk2BVtOZUg55JQM3d619fdw==", "dependencies": { + "@d-fischer/detect-node": "^3.0.1", "@d-fischer/shared-utils": "^3.2.0", - "detect-node": "^2.0.4", "tslib": "^2.0.3" }, "funding": { "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/@d-fischer/promise.allsettled": { - "version": "2.0.2", - "integrity": "sha512-xY0vYDwJYFe22MS5ccQ50N4Mcc2nQ8J4eWE5Y354IxZwW32O5uTT6mmhFSuVF6ZrKvzHOCIrK+9WqOR6TI3tcA==", - "dependencies": { - "array.prototype.map": "^1.0.3", - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "get-intrinsic": "^1.0.2", - "iterate-value": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, "node_modules/@d-fischer/qs": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@d-fischer/qs/-/qs-7.0.2.tgz", "integrity": "sha512-yAu3xDooiL+ef84Jo8nLjDjWBRk7RXk163Y6aTvRB7FauYd3spQD/dWvgT7R4CrN54Juhrrc3dMY7mc+jZGurQ==", "engines": { "node": ">=0.6" @@ -794,33 +741,39 @@ } }, "node_modules/@d-fischer/rate-limiter": { - "version": "0.4.5", - "integrity": "sha512-Q6TSDCbQcHShZAmX7UqG4ipPLjedAE2N5eV+30tr9c3QrejE5zTlNVY6CyX2bydXu+tVKmsajFix89ydpc9fWA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-1.0.1.tgz", + "integrity": "sha512-Mq+0pAJsx92hP83cjmsrXQZVQJ+/+u1JFT6fjH8pj3yfUrbT3eDBsA+6J63eat+QaC+Mci78HdiBfpsdBkdwog==", "dependencies": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/promise.allsettled": "^2.0.2", - "@types/node": "^12.12.5", - "tslib": "^2.0.3" + "@d-fischer/logger": "^4.2.3", + "@d-fischer/shared-utils": "^3.6.3", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/@d-fischer/rate-limiter/node_modules/@types/node": { - "version": "12.20.28", - "integrity": "sha512-cBw8gzxUPYX+/5lugXIPksioBSbE42k0fZ39p+4yRzfYjN6++eq9kAPdlY9qm+MXyfbk9EmvCYAYRn380sF46w==" - }, "node_modules/@d-fischer/shared-utils": { - "version": "3.2.0", - "integrity": "sha512-YgAPpd0jxtchZlEqvVmL21A+/Ottx5759s6THiJs0o5+8pPIrshBlULhmfunbaidHmViuUhjxzZfqRkYl0MR9g==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@d-fischer/shared-utils/-/shared-utils-3.6.3.tgz", + "integrity": "sha512-Lz+Qk1WJLVoeREOHPZcIDTHOoxecxMSG2sq+x1xWYCH1exqiMKMMx06pXdy15UzHG7ohvQRNXk2oHqZ9EOl9jQ==", "dependencies": { - "@types/node": "^14.11.2", - "tslib": "^2.0.3" + "tslib": "^2.4.1" }, "funding": { "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/@d-fischer/shared-utils/node_modules/@types/node": { - "version": "14.17.21", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==" + "node_modules/@d-fischer/typed-event-emitter": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@d-fischer/typed-event-emitter/-/typed-event-emitter-3.3.3.tgz", + "integrity": "sha512-OvSEOa8icfdWDqcRtjSEZtgJTFOFNgTjje7zaL0+nAtu2/kZtRCSK5wUMrI/aXtCH8o0Qz2vA8UqkhWUTARFQQ==", + "dependencies": { + "tslib": "^2.4.0" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } }, "node_modules/@microfleet/ioredis-lock": { "version": "5.0.4", @@ -1379,32 +1332,38 @@ } }, "node_modules/@twurple/api": { - "version": "5.0.5", - "integrity": "sha512-VcZjm/Nre90EwXYJex3RxleGOH/mKaXpoN7g5UgZJ1EG1gFS3xFXWSYm12fhjVU6sAREA3b02cCbmjtfZTXoMQ==", - "dependencies": { - "@d-fischer/cache-decorators": "^3.0.0", - "@d-fischer/logger": "^4.0.0", - "@d-fischer/rate-limiter": "^0.4.4", - "@d-fischer/shared-utils": "^3.2.0", - "@twurple/api-call": "^5.0.5", - "@twurple/common": "^5.0.5", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/api/-/api-7.1.0.tgz", + "integrity": "sha512-cDVVY+vecMFNEOyp7UobQn4ARydIDf04NZy1YCKIKpJHBuOV/pkTjNGluRZ0nR9/t9hBFfOyHAH4JswRZpZbnw==", + "dependencies": { + "@d-fischer/cache-decorators": "^4.0.0", + "@d-fischer/cross-fetch": "^5.0.1", + "@d-fischer/detect-node": "^3.0.1", + "@d-fischer/logger": "^4.2.1", + "@d-fischer/rate-limiter": "^1.0.0", + "@d-fischer/shared-utils": "^3.6.1", + "@d-fischer/typed-event-emitter": "^3.3.1", + "@twurple/api-call": "7.1.0", + "@twurple/common": "7.1.0", + "retry": "^0.13.1", "tslib": "^2.0.3" }, "funding": { "url": "https://github.com/sponsors/d-fischer" }, "peerDependencies": { - "@twurple/auth": "^5.0.0" + "@twurple/auth": "7.1.0" } }, "node_modules/@twurple/api-call": { - "version": "5.0.5", - "integrity": "sha512-J4tkiPCckYi6yIsdgJmF5mBpPepv8va2yHiHgxzl8SUD1kPT3EAEE4uz2lYm+yM3T/NFraaup028FXWIbJ8dYw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/api-call/-/api-call-7.1.0.tgz", + "integrity": "sha512-aiyV492StnILyFzU/Eqgn+BA8fz125sB/0QJVlCJotMolrZxBkA4NsFEGDOcR3rOJLL7zOKPYMhWI8zY0gfzPA==", "dependencies": { - "@d-fischer/cross-fetch": "^4.0.2", + "@d-fischer/cross-fetch": "^5.0.1", "@d-fischer/qs": "^7.0.2", - "@twurple/common": "^5.0.5", - "@types/node-fetch": "^2.5.7", + "@d-fischer/shared-utils": "^3.6.1", + "@twurple/common": "7.1.0", "tslib": "^2.0.3" }, "funding": { @@ -1412,13 +1371,15 @@ } }, "node_modules/@twurple/auth": { - "version": "5.0.5", - "integrity": "sha512-U2M/seGTx4FhnLeL8HFmtc3B7OAfDrWIih6hzCYihESeufw6VLiLgEXLzJumtZlgXXA5Z26LeOtKh3cr2et3fw==", - "dependencies": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/shared-utils": "^3.2.0", - "@twurple/api-call": "^5.0.5", - "@twurple/common": "^5.0.5", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/auth/-/auth-7.1.0.tgz", + "integrity": "sha512-OT7XtoXeYA8yLvCKdIZ76x71D/RfxPZQqufpimy5ZSL4+TpxY1CJNFp8YWstC1KEfyGVwyr7ZoV49u95k0JJmw==", + "dependencies": { + "@d-fischer/logger": "^4.2.1", + "@d-fischer/shared-utils": "^3.6.1", + "@d-fischer/typed-event-emitter": "^3.3.1", + "@twurple/api-call": "7.1.0", + "@twurple/common": "7.1.0", "tslib": "^2.0.3" }, "funding": { @@ -1426,10 +1387,11 @@ } }, "node_modules/@twurple/common": { - "version": "5.0.5", - "integrity": "sha512-ZosJZLJnJVnJw9YHVO7I9hATjky/tvW4+qWFGBhU27xXHINKTO/k3e2W0xdMxRaMa91BP+anjDk5kroNyUyBgQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/common/-/common-7.1.0.tgz", + "integrity": "sha512-kz3J9J116+aOdyhCzRQwaxFC5eAewwQ9Iv2UmPHXYqRfbgKay6TsL27vk+Q2HygBCvx/8OWpX3pdSo3V/VPmoA==", "dependencies": { - "@d-fischer/shared-utils": "^3.2.0", + "@d-fischer/shared-utils": "^3.6.1", "klona": "^2.0.4", "tslib": "^2.0.3" }, @@ -1476,6 +1438,7 @@ "version": "2.6.5", "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.5.tgz", "integrity": "sha512-OZsUlr2nxvkqUFLSaY2ZbA+P1q22q+KrlxWOn/38RX+u5kTkYL2mTujEpzUhGkS+K/QCYp9oagfXG39XOzyySg==", + "dev": true, "dependencies": { "@types/node": "*", "form-data": "^4.0.0" @@ -1613,23 +1576,6 @@ "node": ">=8" } }, - "node_modules/array.prototype.map": { - "version": "1.0.4", - "integrity": "sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/arrify": { "version": "2.0.1", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", @@ -2141,10 +2087,6 @@ "node": ">=0.10" } }, - "node_modules/detect-node": { - "version": "2.1.0", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" - }, "node_modules/diff": { "version": "4.0.2", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", @@ -2332,27 +2274,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" - }, - "node_modules/es-get-iterator": { - "version": "1.1.2", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.0", - "has-symbols": "^1.0.1", - "is-arguments": "^1.1.0", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.5", - "isarray": "^2.0.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-to-primitive": { "version": "1.2.1", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", @@ -2482,6 +2403,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -2918,20 +2840,6 @@ "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" }, - "node_modules/is-arguments": { - "version": "1.1.1", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-bigint": { "version": "1.0.4", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", @@ -3032,13 +2940,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-map": { - "version": "2.0.2", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-negative-zero": { "version": "2.0.1", "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", @@ -3084,13 +2985,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-set": { - "version": "2.0.2", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-shared-array-buffer": { "version": "1.0.1", "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", @@ -3149,10 +3043,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/isarray": { - "version": "2.0.5", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, "node_modules/isexe": { "version": "2.0.0", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", @@ -3162,24 +3052,6 @@ "version": "0.1.2", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "node_modules/iterate-iterator": { - "version": "1.0.2", - "integrity": "sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/iterate-value": { - "version": "1.0.2", - "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", - "dependencies": { - "es-get-iterator": "^1.0.2", - "iterate-iterator": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/jpeg-js": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", @@ -3247,8 +3119,9 @@ } }, "node_modules/klona": { - "version": "2.0.4", - "integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", "engines": { "node": ">= 8" } @@ -4092,6 +3965,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "engines": { + "node": ">= 4" + } + }, "node_modules/rimraf": { "version": "2.7.1", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", @@ -5404,110 +5285,66 @@ } }, "@d-fischer/cache-decorators": { - "version": "3.0.0", - "integrity": "sha512-mYUCjrp5hJgimceC5bof3zzmElyxzW4ty+73IjY12wvxLAqsq0CbgLGspnJm6KgwEfGoeRnISZD4EXJidG3FvA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-4.0.1.tgz", + "integrity": "sha512-HNYLBLWs/t28GFZZeqdIBqq8f37mqDIFO6xNPof94VjpKvuP6ROqCZGafx88dk5zZUlBfViV9jD8iNNlXfc4CA==", "requires": { - "@d-fischer/shared-utils": "^3.0.1", - "@types/node": "^14.14.22", - "tslib": "^2.1.0" - }, - "dependencies": { - "@types/node": { - "version": "14.17.21", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==" - } + "@d-fischer/shared-utils": "^3.6.3", + "tslib": "^2.6.2" } }, "@d-fischer/cross-fetch": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-4.1.0.tgz", - "integrity": "sha512-HH87JacceXOANr5XuBuSIQmPRPOvOUPwU1JR0DLUT6A8jGcP0jq2YUAiFCyZ8VGwDbTjsD3CZFpWIp5o7mIFWQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-5.0.5.tgz", + "integrity": "sha512-symjDUPInTrkfIsZc2n2mo9hiAJLcTJsZkNICjZajEWnWpJ3s3zn50/FY8xpNUAf5w3eFuQii2wxztTGpvG1Xg==", "requires": { - "node-fetch": "2.6.7" - }, - "dependencies": { - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } + "node-fetch": "^2.6.12" } }, + "@d-fischer/detect-node": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@d-fischer/detect-node/-/detect-node-3.0.1.tgz", + "integrity": "sha512-0Rf3XwTzuTh8+oPZW9SfxTIiL+26RRJ0BRPwj5oVjZFyFKmsj9RGfN2zuTRjOuA3FCK/jYm06HOhwNK+8Pfv8w==" + }, "@d-fischer/logger": { - "version": "4.1.1", - "integrity": "sha512-yQPteWFcO7+js+AxE/uO01gN4E6rxaePWLKnLAUT+0aFcaRq+kWWCoI5r2fa04jbadn9qUpSVxvK/YiC9cfVjw==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.3.tgz", + "integrity": "sha512-mJUx9OgjrNVLQa4od/+bqnmD164VTCKnK5B4WOW8TX5y/3w2i58p+PMRE45gUuFjk2BVtOZUg55JQM3d619fdw==", "requires": { + "@d-fischer/detect-node": "^3.0.1", "@d-fischer/shared-utils": "^3.2.0", - "detect-node": "^2.0.4", "tslib": "^2.0.3" } }, - "@d-fischer/promise.allsettled": { - "version": "2.0.2", - "integrity": "sha512-xY0vYDwJYFe22MS5ccQ50N4Mcc2nQ8J4eWE5Y354IxZwW32O5uTT6mmhFSuVF6ZrKvzHOCIrK+9WqOR6TI3tcA==", - "requires": { - "array.prototype.map": "^1.0.3", - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "get-intrinsic": "^1.0.2", - "iterate-value": "^1.0.2" - } - }, "@d-fischer/qs": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@d-fischer/qs/-/qs-7.0.2.tgz", "integrity": "sha512-yAu3xDooiL+ef84Jo8nLjDjWBRk7RXk163Y6aTvRB7FauYd3spQD/dWvgT7R4CrN54Juhrrc3dMY7mc+jZGurQ==" }, "@d-fischer/rate-limiter": { - "version": "0.4.5", - "integrity": "sha512-Q6TSDCbQcHShZAmX7UqG4ipPLjedAE2N5eV+30tr9c3QrejE5zTlNVY6CyX2bydXu+tVKmsajFix89ydpc9fWA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-1.0.1.tgz", + "integrity": "sha512-Mq+0pAJsx92hP83cjmsrXQZVQJ+/+u1JFT6fjH8pj3yfUrbT3eDBsA+6J63eat+QaC+Mci78HdiBfpsdBkdwog==", "requires": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/promise.allsettled": "^2.0.2", - "@types/node": "^12.12.5", - "tslib": "^2.0.3" - }, - "dependencies": { - "@types/node": { - "version": "12.20.28", - "integrity": "sha512-cBw8gzxUPYX+/5lugXIPksioBSbE42k0fZ39p+4yRzfYjN6++eq9kAPdlY9qm+MXyfbk9EmvCYAYRn380sF46w==" - } + "@d-fischer/logger": "^4.2.3", + "@d-fischer/shared-utils": "^3.6.3", + "tslib": "^2.6.2" } }, "@d-fischer/shared-utils": { - "version": "3.2.0", - "integrity": "sha512-YgAPpd0jxtchZlEqvVmL21A+/Ottx5759s6THiJs0o5+8pPIrshBlULhmfunbaidHmViuUhjxzZfqRkYl0MR9g==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@d-fischer/shared-utils/-/shared-utils-3.6.3.tgz", + "integrity": "sha512-Lz+Qk1WJLVoeREOHPZcIDTHOoxecxMSG2sq+x1xWYCH1exqiMKMMx06pXdy15UzHG7ohvQRNXk2oHqZ9EOl9jQ==", "requires": { - "@types/node": "^14.11.2", - "tslib": "^2.0.3" - }, - "dependencies": { - "@types/node": { - "version": "14.17.21", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==" - } + "tslib": "^2.4.1" + } + }, + "@d-fischer/typed-event-emitter": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@d-fischer/typed-event-emitter/-/typed-event-emitter-3.3.3.tgz", + "integrity": "sha512-OvSEOa8icfdWDqcRtjSEZtgJTFOFNgTjje7zaL0+nAtu2/kZtRCSK5wUMrI/aXtCH8o0Qz2vA8UqkhWUTARFQQ==", + "requires": { + "tslib": "^2.4.0" } }, "@microfleet/ioredis-lock": { @@ -5956,45 +5793,54 @@ } }, "@twurple/api": { - "version": "5.0.5", - "integrity": "sha512-VcZjm/Nre90EwXYJex3RxleGOH/mKaXpoN7g5UgZJ1EG1gFS3xFXWSYm12fhjVU6sAREA3b02cCbmjtfZTXoMQ==", - "requires": { - "@d-fischer/cache-decorators": "^3.0.0", - "@d-fischer/logger": "^4.0.0", - "@d-fischer/rate-limiter": "^0.4.4", - "@d-fischer/shared-utils": "^3.2.0", - "@twurple/api-call": "^5.0.5", - "@twurple/common": "^5.0.5", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/api/-/api-7.1.0.tgz", + "integrity": "sha512-cDVVY+vecMFNEOyp7UobQn4ARydIDf04NZy1YCKIKpJHBuOV/pkTjNGluRZ0nR9/t9hBFfOyHAH4JswRZpZbnw==", + "requires": { + "@d-fischer/cache-decorators": "^4.0.0", + "@d-fischer/cross-fetch": "^5.0.1", + "@d-fischer/detect-node": "^3.0.1", + "@d-fischer/logger": "^4.2.1", + "@d-fischer/rate-limiter": "^1.0.0", + "@d-fischer/shared-utils": "^3.6.1", + "@d-fischer/typed-event-emitter": "^3.3.1", + "@twurple/api-call": "7.1.0", + "@twurple/common": "7.1.0", + "retry": "^0.13.1", "tslib": "^2.0.3" } }, "@twurple/api-call": { - "version": "5.0.5", - "integrity": "sha512-J4tkiPCckYi6yIsdgJmF5mBpPepv8va2yHiHgxzl8SUD1kPT3EAEE4uz2lYm+yM3T/NFraaup028FXWIbJ8dYw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/api-call/-/api-call-7.1.0.tgz", + "integrity": "sha512-aiyV492StnILyFzU/Eqgn+BA8fz125sB/0QJVlCJotMolrZxBkA4NsFEGDOcR3rOJLL7zOKPYMhWI8zY0gfzPA==", "requires": { - "@d-fischer/cross-fetch": "^4.0.2", + "@d-fischer/cross-fetch": "^5.0.1", "@d-fischer/qs": "^7.0.2", - "@twurple/common": "^5.0.5", - "@types/node-fetch": "^2.5.7", + "@d-fischer/shared-utils": "^3.6.1", + "@twurple/common": "7.1.0", "tslib": "^2.0.3" } }, "@twurple/auth": { - "version": "5.0.5", - "integrity": "sha512-U2M/seGTx4FhnLeL8HFmtc3B7OAfDrWIih6hzCYihESeufw6VLiLgEXLzJumtZlgXXA5Z26LeOtKh3cr2et3fw==", - "requires": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/shared-utils": "^3.2.0", - "@twurple/api-call": "^5.0.5", - "@twurple/common": "^5.0.5", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/auth/-/auth-7.1.0.tgz", + "integrity": "sha512-OT7XtoXeYA8yLvCKdIZ76x71D/RfxPZQqufpimy5ZSL4+TpxY1CJNFp8YWstC1KEfyGVwyr7ZoV49u95k0JJmw==", + "requires": { + "@d-fischer/logger": "^4.2.1", + "@d-fischer/shared-utils": "^3.6.1", + "@d-fischer/typed-event-emitter": "^3.3.1", + "@twurple/api-call": "7.1.0", + "@twurple/common": "7.1.0", "tslib": "^2.0.3" } }, "@twurple/common": { - "version": "5.0.5", - "integrity": "sha512-ZosJZLJnJVnJw9YHVO7I9hATjky/tvW4+qWFGBhU27xXHINKTO/k3e2W0xdMxRaMa91BP+anjDk5kroNyUyBgQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@twurple/common/-/common-7.1.0.tgz", + "integrity": "sha512-kz3J9J116+aOdyhCzRQwaxFC5eAewwQ9Iv2UmPHXYqRfbgKay6TsL27vk+Q2HygBCvx/8OWpX3pdSo3V/VPmoA==", "requires": { - "@d-fischer/shared-utils": "^3.2.0", + "@d-fischer/shared-utils": "^3.6.1", "klona": "^2.0.4", "tslib": "^2.0.3" } @@ -6038,6 +5884,7 @@ "version": "2.6.5", "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.5.tgz", "integrity": "sha512-OZsUlr2nxvkqUFLSaY2ZbA+P1q22q+KrlxWOn/38RX+u5kTkYL2mTujEpzUhGkS+K/QCYp9oagfXG39XOzyySg==", + "dev": true, "requires": { "@types/node": "*", "form-data": "^4.0.0" @@ -6144,17 +5991,6 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "array.prototype.map": { - "version": "1.0.4", - "integrity": "sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA==", - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - } - }, "arrify": { "version": "2.0.1", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", @@ -6524,10 +6360,6 @@ "version": "1.5.1", "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==" }, - "detect-node": { - "version": "2.1.0", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" - }, "diff": { "version": "4.0.2", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", @@ -6668,24 +6500,6 @@ "unbox-primitive": "^1.0.1" } }, - "es-array-method-boxes-properly": { - "version": "1.0.0", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" - }, - "es-get-iterator": { - "version": "1.1.2", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.0", - "has-symbols": "^1.0.1", - "is-arguments": "^1.1.0", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.5", - "isarray": "^2.0.5" - } - }, "es-to-primitive": { "version": "1.2.1", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", @@ -6777,6 +6591,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -7080,14 +6895,6 @@ "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" }, - "is-arguments": { - "version": "1.1.1", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, "is-bigint": { "version": "1.0.4", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", @@ -7152,10 +6959,6 @@ "is-extglob": "^2.1.1" } }, - "is-map": { - "version": "2.0.2", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==" - }, "is-negative-zero": { "version": "2.0.1", "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" @@ -7180,10 +6983,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-set": { - "version": "2.0.2", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==" - }, "is-shared-array-buffer": { "version": "1.0.1", "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==" @@ -7218,10 +7017,6 @@ "call-bind": "^1.0.0" } }, - "isarray": { - "version": "2.0.5", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, "isexe": { "version": "2.0.0", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", @@ -7231,18 +7026,6 @@ "version": "0.1.2", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "iterate-iterator": { - "version": "1.0.2", - "integrity": "sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw==" - }, - "iterate-value": { - "version": "1.0.2", - "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", - "requires": { - "es-get-iterator": "^1.0.2", - "iterate-iterator": "^1.0.1" - } - }, "jpeg-js": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", @@ -7304,8 +7087,9 @@ } }, "klona": { - "version": "2.0.4", - "integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==" }, "lodash.clonedeep": { "version": "4.5.0", @@ -7921,6 +7705,11 @@ "lowercase-keys": "^3.0.0" } }, + "retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==" + }, "rimraf": { "version": "2.7.1", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", diff --git a/package.json b/package.json index bbc847fc6..31cb0fad2 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "homepage": "https://member-counter.eduardozgz.com", "dependencies": { "@arcanebot/redis-sharder": "github:eduardozgz/redis-sharder", - "@twurple/api": "^5.0.1", - "@twurple/auth": "^5.0.1", + "@twurple/api": "^7.0.6", + "@twurple/auth": "^7.0.6", "bufferutil": "^4.0.1", "colorthief": "2.3.2", "cron": "^1.8.2", diff --git a/src/counters/Twitch.ts b/src/counters/Twitch.ts index fb9e343ea..e35069149 100644 --- a/src/counters/Twitch.ts +++ b/src/counters/Twitch.ts @@ -1,11 +1,11 @@ import { ApiClient } from "@twurple/api"; -import { ClientCredentialsAuthProvider } from "@twurple/auth"; +import { AppTokenAuthProvider } from "@twurple/auth"; import getEnv from "../utils/getEnv"; import Counter from "../typings/Counter"; const { TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET } = getEnv(); -const authProvider = new ClientCredentialsAuthProvider( +const authProvider = new AppTokenAuthProvider( TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET ); @@ -13,25 +13,34 @@ const authProvider = new ClientCredentialsAuthProvider( const client = new ApiClient({ authProvider }); const TwitchCounter: Counter = { - aliases: ["twitchFollowers", "twitchViews", "twitchChannelName"], + aliases: ["twitchFollowers", "twitchViewers", "twitchChannelName"], isPremium: true, isEnabled: true, lifetime: 60 * 60 * 1000, execute: async ({ unparsedArgs: userName }) => { try { if (!TWITCH_CLIENT_ID) throw new Error("TWITCH_CLIENT_ID not provided"); - if (!TWITCH_CLIENT_SECRET) - throw new Error("TWITCH_CLIENT_SECRET not provided"); + if (!TWITCH_CLIENT_SECRET) throw new Error("TWITCH_CLIENT_SECRET not provided"); - const user = await client.users.getUserByName(userName); - const { views, displayName } = user; - const followers = await client.users - .getFollowsPaginated({ followedUser: user }) - .getTotalCount(); + const channel = await client.users.getUserByName(userName); + if (!channel) { + return { + twitchFollowers: "User Not Found", + twitchViewers: "User Not Found", + twitchChannelName: "User Not Found" + }; + } + const { displayName } = channel; + const stream = await client.streams.getStreamByUserName(userName); + let viewers = "Offline"; + if (stream !== null) { + viewers = stream.viewers.toString(); + } + const followers = await client.channels.getChannelFollowerCount(channel.id); return { twitchFollowers: followers, - twitchViews: views, + twitchViewers: viewers, twitchChannelName: displayName }; } catch (e) { diff --git a/src/lang/ca_ES.json b/src/lang/ca_ES.json index f81b48f1f..84e043d90 100644 --- a/src/lang/ca_ES.json +++ b/src/lang/ca_ES.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/cs_CZ.json b/src/lang/cs_CZ.json index 8f5c4a5ae..88119e40b 100644 --- a/src/lang/cs_CZ.json +++ b/src/lang/cs_CZ.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} sledujících", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/de_DE.json b/src/lang/de_DE.json index 8e4419a25..139f12a65 100644 --- a/src/lang/de_DE.json +++ b/src/lang/de_DE.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/en_US.json b/src/lang/en_US.json index bd79f8951..dd692f3e7 100644 --- a/src/lang/en_US.json +++ b/src/lang/en_US.json @@ -247,12 +247,16 @@ "usage": ["{twitchFollowers:nickname}"], "example": ["{twitchFollowers:ninja} Followers"] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", - "usage": ["{twitchViews:nickname}"], - "example": ["{twitchViews:ninja} Views"] + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", + "usage": [ + "{twitchViewers:nickname}" + ], + "example": [ + "{twitchViewers:ninja} Views" + ] }, "twitchChannelName": { "name": "twitchChannelName:nickname", @@ -642,8 +646,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/es_ES.json b/src/lang/es_ES.json index c2251729f..4586bbff3 100644 --- a/src/lang/es_ES.json +++ b/src/lang/es_ES.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Seguidores" ] }, - "twitchViews": { - "name": "twitchViews:nombre", - "description": "Cantidad de vistas de un canal de Twitch", - "detailedDescription": "Cuenta cuántas visualizaciones tiene un canal de Twitch, reemplaza `nombre` con el nombre del canal deseado", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nombre}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Visualizaciones" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,10 +848,10 @@ "statusCreated": "{CHECK_MARK} Contador de seguidores creado" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Visitas", - "statusCreating": "{LOADING} Creando contador de visitas", - "statusCreated": "{CHECK_MARK} Contador de visitas creado" + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", + "statusCreating": "{LOADING} Creating views counter", + "statusCreated": "{CHECK_MARK} Views counter created" } ] }, diff --git a/src/lang/fa_IR.json b/src/lang/fa_IR.json index e0b57353b..bfed54073 100644 --- a/src/lang/fa_IR.json +++ b/src/lang/fa_IR.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} دنبال کننده ها" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "تعداد بازدید های یک چنل توییچ", - "detailedDescription": "تعداد بازدید های یک چنل توییچ را می شمارد. قسمت `nickname` را با نام چنل توییچ دلخواه تغییر دهید", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} بازدید ها" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,10 +848,10 @@ "statusCreated": "{CHECK_MARK} شمارنده دنبال‌کننده ساخته شد" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} بازدید ها", - "statusCreating": "{LOADING} درحال ساخت شمارنده میزان بازدید ها", - "statusCreated": "{CHECK_MARK} شمارنده میزان بازدید ها ساخته شد" + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", + "statusCreating": "{LOADING} Creating views counter", + "statusCreated": "{CHECK_MARK} Views counter created" } ] }, diff --git a/src/lang/fr_FR.json b/src/lang/fr_FR.json index 0904e184e..869955dc6 100644 --- a/src/lang/fr_FR.json +++ b/src/lang/fr_FR.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/he_IL.json b/src/lang/he_IL.json index f9bd3058e..395f4ca21 100644 --- a/src/lang/he_IL.json +++ b/src/lang/he_IL.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/hi_IN.json b/src/lang/hi_IN.json index ab0df301b..7577cbd59 100644 --- a/src/lang/hi_IN.json +++ b/src/lang/hi_IN.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,10 +848,10 @@ "statusCreated": "{CHECK_MARK} अनुयायी काउंटर बनाई गई" }, { - "name": "twitchViews", - "template": "{twitchFollowers:{RESOURCE}} ट्विच दर्शक", - "statusCreating": "{LOADING} व्यू काउंटर बनाई जा रही है", - "statusCreated": "{CHECK_MARK} व्यू काउंटर बनाया गया" + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", + "statusCreating": "{LOADING} Creating views counter", + "statusCreated": "{CHECK_MARK} Views counter created" } ] }, diff --git a/src/lang/it_IT.json b/src/lang/it_IT.json index f510f0fb6..2c8f5e16c 100644 --- a/src/lang/it_IT.json +++ b/src/lang/it_IT.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/pl_PL.json b/src/lang/pl_PL.json index a9bf3a988..409c0eeae 100644 --- a/src/lang/pl_PL.json +++ b/src/lang/pl_PL.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/pt_BR.json b/src/lang/pt_BR.json index 2905b0ce1..9790b018c 100644 --- a/src/lang/pt_BR.json +++ b/src/lang/pt_BR.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,8 +848,8 @@ "statusCreated": "{CHECK_MARK} Follower counter created" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Views", + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", "statusCreating": "{LOADING} Creating views counter", "statusCreated": "{CHECK_MARK} Views counter created" } diff --git a/src/lang/ru_RU.json b/src/lang/ru_RU.json index cf47390f8..d94661e37 100644 --- a/src/lang/ru_RU.json +++ b/src/lang/ru_RU.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Followers" ] }, - "twitchViews": { - "name": "twitchViews:nickname", - "description": "Amount of views of a Twitch channel", - "detailedDescription": "Counts how many views has a Twitch channel, replace `nickname` with the desired channel name", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Кол-во зрителей на стриме", + "detailedDescription": "Считает количество зрителей на активном стриме, замените `nickname` на имя желаемого канала", "usage": [ - "{twitchViews:nickname}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Views" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,10 +848,10 @@ "statusCreated": "{CHECK_MARK} Счётчик фолловеров создан" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Просмотры", - "statusCreating": "{LOADING} Создание счётчика просмотров", - "statusCreated": "{CHECK_MARK} Счётчик просмотров создан" + "name": "twitchViewers", + "template": "Зрители {twitchViewers:{RESOURCE}}", + "statusCreating": "{LOADING} Создание счетчика зрителей", + "statusCreated": "{CHECK_MARK} Счетчик зрителей создан" } ] }, diff --git a/src/lang/tr_TR.json b/src/lang/tr_TR.json index 935cc56eb..e5859da59 100644 --- a/src/lang/tr_TR.json +++ b/src/lang/tr_TR.json @@ -328,15 +328,15 @@ "{twitchFollowers:ninja} Takipçi" ] }, - "twitchViews": { - "name": "twitchViews:kullanıcıAdı", - "description": "Bir Twitch kanalının izlenme sayısını gösterir", - "detailedDescription": "Bir Twitch kanalının kaç kez görüntülendiğini sayar, `kullanıcıAdı` bölümünü istediğiniz kanal adıyla değiştirin", + "twitchViewers": { + "name": "twitchViewers:nickname", + "description": "Amount of stream viewers", + "detailedDescription": "Counts how many viewers are there on an active stream, replace `nickname` with the desired channel name", "usage": [ - "{twitchViews:kullanıcıAdı}" + "{twitchViewers:nickname}" ], "example": [ - "{twitchViews:ninja} Görüntüleme" + "{twitchViewers:ninja} Views" ] }, "twitchChannelName": { @@ -848,10 +848,10 @@ "statusCreated": "{CHECK_MARK} Takipçi sayacı oluşturuldu" }, { - "name": "twitchViews", - "template": "{twitchViews:{RESOURCE}} Görüntüleme", - "statusCreating": "{LOADING} Görüntüleme sayacı oluşturuluyor", - "statusCreated": "{CHECK_MARK} Görüntüleme sayacı oluşturuldu" + "name": "twitchViewers", + "template": "Viewers {twitchViewers:{RESOURCE}}", + "statusCreating": "{LOADING} Creating views counter", + "statusCreated": "{CHECK_MARK} Views counter created" } ] }, diff --git a/src/typings/LanguagePack.ts b/src/typings/LanguagePack.ts index 73cf22a9d..3de12f52e 100644 --- a/src/typings/LanguagePack.ts +++ b/src/typings/LanguagePack.ts @@ -294,7 +294,7 @@ interface Counters { youtubeVideos: Members; youtubeChannelName: Members; twitchFollowers: Members; - twitchViews: Members; + twitchViewers: Members; twitchChannelName: Members; memeratorMemes: Members; memeratorFollowers: Members;