Rework pagination, fix caption2 font, some logging fixes, updated packages

This commit is contained in:
Essem 2022-02-02 11:01:33 -06:00
parent b69ffe0a0c
commit 26741e8c6c
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
7 changed files with 249 additions and 239 deletions

View file

@ -68,7 +68,7 @@ const acceptJob = (id, sock) => {
}, sock).then(() => { }, sock).then(() => {
log(`Job ${id} has finished`); log(`Job ${id} has finished`);
}).catch((err) => { }).catch((err) => {
error(`Error on job ${id}:`, err, job.num); error(`Error on job ${id}: ${err}`, job.num);
const newJob = jobs.get(id); const newJob = jobs.get(id);
if (!newJob.tag) { if (!newJob.tag) {
newJob.error = err.message; newJob.error = err.message;

View file

@ -42,7 +42,6 @@ Napi::Value CaptionTwo(const Napi::CallbackInfo &info) {
caption_image.fontPointsize(width / 17); caption_image.fontPointsize(width / 17);
caption_image.read("pango:<span font_family=\"" + caption_image.read("pango:<span font_family=\"" +
(font == "roboto" ? "Roboto Condensed" : font) + (font == "roboto" ? "Roboto Condensed" : font) +
"\" weight=\"" + (font != "impact" ? "bold" : "normal") +
"\">" + caption + "</span>"); "\">" + caption + "</span>");
caption_image.extent(Geometry(width, caption_image.rows() + (width / 25)), caption_image.extent(Geometry(width, caption_image.rows() + (width / 25)),
Magick::CenterGravity); Magick::CenterGravity);

377
package-lock.json generated
View file

@ -12,17 +12,17 @@
"@top-gg/sdk": "^3.1.1", "@top-gg/sdk": "^3.1.1",
"cmake-js": "^6.3.0", "cmake-js": "^6.3.0",
"cowsay2": "^2.0.4", "cowsay2": "^2.0.4",
"dotenv": "^10.0.0", "dotenv": "^15.0.0",
"emoji-regex": "^10.0.0", "emoji-regex": "^10.0.0",
"eris": "^0.16.1", "eris": "^0.16.1",
"eris-fleet": "^1.0.0", "eris-fleet": "^1.0.0",
"file-type": "^16.1.0", "file-type": "^17.1.1",
"format-duration": "^1.4.0", "format-duration": "^1.4.0",
"jsqr": "^1.3.1", "jsqr": "^1.3.1",
"lavacord": "^1.1.9", "lavacord": "^1.1.9",
"node-addon-api": "^4.2.0", "node-addon-api": "^4.3.0",
"node-emoji": "^1.10.0", "node-emoji": "^1.10.0",
"node-fetch": "^3.1.1", "node-fetch": "^3.2.0",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"sharp": "^0.29.3", "sharp": "^0.29.3",
"winston": "^3.3.3" "winston": "^3.3.3"
@ -35,7 +35,7 @@
"@babel/eslint-plugin": "^7.13.0", "@babel/eslint-plugin": "^7.13.0",
"@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.13.0",
"eslint": "^8.2.0", "eslint": "^8.2.0",
"eslint-plugin-unicorn": "^38.0.1" "eslint-plugin-unicorn": "^40.1.0"
}, },
"engines": { "engines": {
"node": ">=15" "node": ">=15"
@ -67,6 +67,7 @@
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz",
"integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
@ -76,6 +77,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz",
"integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.16.7", "@babel/code-frame": "^7.16.7",
"@babel/generator": "^7.16.8", "@babel/generator": "^7.16.8",
@ -166,6 +168,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz",
"integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/compat-data": "^7.16.4", "@babel/compat-data": "^7.16.4",
"@babel/helper-validator-option": "^7.16.7", "@babel/helper-validator-option": "^7.16.7",
@ -267,6 +270,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
"integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.16.7" "@babel/types": "^7.16.7"
}, },
@ -279,6 +283,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz",
"integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-environment-visitor": "^7.16.7",
"@babel/helper-module-imports": "^7.16.7", "@babel/helper-module-imports": "^7.16.7",
@ -335,6 +340,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz",
"integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.16.7" "@babel/types": "^7.16.7"
}, },
@ -368,6 +374,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
"integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
@ -377,6 +384,7 @@
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz",
"integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/template": "^7.16.7", "@babel/template": "^7.16.7",
"@babel/traverse": "^7.16.7", "@babel/traverse": "^7.16.7",
@ -861,6 +869,7 @@
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001286", "caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17", "electron-to-chromium": "^1.4.17",
@ -983,10 +992,11 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001303", "version": "1.0.30001304",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001303.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz",
"integrity": "sha512-/Mqc1oESndUNszJP0kx0UaQU9kEv9nNtJ7Kn8AdA0mNnH8eR1cj0kG+NbNuC1Wq/b21eA8prhKRA3bbkjONegQ==", "integrity": "sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ==",
"dev": true, "dev": true,
"peer": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/browserslist" "url": "https://opencollective.com/browserslist"
@ -1138,12 +1148,12 @@
} }
}, },
"node_modules/color": { "node_modules/color": {
"version": "3.2.1", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "resolved": "https://registry.npmjs.org/color/-/color-4.2.0.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "integrity": "sha512-hHTcrbvEnGjC7WBMk6ibQWFVDgEFTVmjrz2Q5HlU6ltwxv0JJN2Z8I7uRbWeQLF04dikxs8zgyZkazRJvSMtyQ==",
"dependencies": { "dependencies": {
"color-convert": "^1.9.3", "color-convert": "^2.0.1",
"color-string": "^1.6.0" "color-string": "^1.9.0"
} }
}, },
"node_modules/color-convert": { "node_modules/color-convert": {
@ -1168,6 +1178,22 @@
"simple-swizzle": "^0.2.2" "simple-swizzle": "^0.2.2"
} }
}, },
"node_modules/color/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/colors": { "node_modules/colors": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
@ -1185,6 +1211,15 @@
"text-hex": "1.0.x" "text-hex": "1.0.x"
} }
}, },
"node_modules/colorspace/node_modules/color": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
"dependencies": {
"color-convert": "^1.9.3",
"color-string": "^1.6.0"
}
},
"node_modules/concat-map": { "node_modules/concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -1200,6 +1235,7 @@
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
"integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"safe-buffer": "~5.1.1" "safe-buffer": "~5.1.1"
} }
@ -1351,11 +1387,11 @@
} }
}, },
"node_modules/dotenv": { "node_modules/dotenv": {
"version": "10.0.0", "version": "15.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-15.0.0.tgz",
"integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", "integrity": "sha512-/l1sXXm79ry34KwwS0y4oVZjB468iw/6u9g1W26dtexKcIJAnVL2pMF+hxQwzZ7LutxOwEgtym9eIxvX33CMKg==",
"engines": { "engines": {
"node": ">=10" "node": ">=12"
} }
}, },
"node_modules/duplexer2": { "node_modules/duplexer2": {
@ -1394,10 +1430,11 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.4.57", "version": "1.4.58",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.57.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.58.tgz",
"integrity": "sha512-FNC+P5K1n6pF+M0zIK+gFCoXcJhhzDViL3DRIGy2Fv5PohuSES1JHR7T+GlwxSxlzx4yYbsuzCZvHxcBSRCIOw==", "integrity": "sha512-7LXwnKyqcEaMFVXOer+2JPfFs1D+ej7yRRrfZoIH1YlLQZ81OvBNwSCBBLtExVkoMQQgOWwO0FbZVge6U/8rhQ==",
"dev": true "dev": true,
"peer": true
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "10.0.0", "version": "10.0.0",
@ -1469,6 +1506,7 @@
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
@ -1535,23 +1573,22 @@
} }
}, },
"node_modules/eslint-plugin-unicorn": { "node_modules/eslint-plugin-unicorn": {
"version": "38.0.1", "version": "40.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-38.0.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-40.1.0.tgz",
"integrity": "sha512-eu4HCg7Bv43nk/hYZoWpLzRo668Nb7swQySn94aohn0heh9KLJ1GOFgVxJndLS8BploMGaClxgsyTNGJrP69yw==", "integrity": "sha512-y5doK2DF9Sr5AqKEHbHxjFllJ167nKDRU01HDcWyv4Tnmaoe9iNxMrBnaybZvWZUaE3OC5Unu0lNIevYamloig==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-validator-identifier": "^7.14.9", "@babel/helper-validator-identifier": "^7.15.7",
"ci-info": "^3.2.0", "ci-info": "^3.3.0",
"clean-regexp": "^1.0.0", "clean-regexp": "^1.0.0",
"eslint-template-visitor": "^2.3.2",
"eslint-utils": "^3.0.0", "eslint-utils": "^3.0.0",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"indent-string": "4", "indent-string": "^4.0.0",
"is-builtin-module": "^3.1.0", "is-builtin-module": "^3.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"read-pkg-up": "^7.0.1", "read-pkg-up": "^7.0.1",
"regexp-tree": "^0.1.23", "regexp-tree": "^0.1.24",
"safe-regex": "^2.1.1", "safe-regex": "^2.1.1",
"semver": "^7.3.5", "semver": "^7.3.5",
"strip-indent": "^3.0.0" "strip-indent": "^3.0.0"
@ -1603,22 +1640,6 @@
"node": ">=8.0.0" "node": ">=8.0.0"
} }
}, },
"node_modules/eslint-template-visitor": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/eslint-template-visitor/-/eslint-template-visitor-2.3.2.tgz",
"integrity": "sha512-3ydhqFpuV7x1M9EK52BPNj6V0Kwu0KKkcIAfpUhwHbR8ocRln/oUHgfxQupY8O1h4Qv/POHDumb/BwwNfxbtnA==",
"dev": true,
"dependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"eslint-visitor-keys": "^2.0.0",
"esquery": "^1.3.1",
"multimap": "^1.1.0"
},
"peerDependencies": {
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-utils": { "node_modules/eslint-utils": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
@ -1935,16 +1956,16 @@
} }
}, },
"node_modules/file-type": { "node_modules/file-type": {
"version": "16.5.3", "version": "17.1.1",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.3.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.1.tgz",
"integrity": "sha512-uVsl7iFhHSOY4bEONLlTK47iAHtNsFHWP5YE4xJfZ4rnX7S1Q3wce09XgqSC7E/xh8Ncv/be1lNoyprlUH/x6A==", "integrity": "sha512-heRUMZHby2Qj6wZAA3YHeMlRmZNQTcb6VxctkGmM+mcM6ROQKvHpr7SS6EgdfEhH+s25LDshBjvPx/Ecm+bOVQ==",
"dependencies": { "dependencies": {
"readable-web-to-node-stream": "^3.0.0", "readable-web-to-node-stream": "^3.0.2",
"strtok3": "^6.2.4", "strtok3": "^7.0.0-alpha.7",
"token-types": "^4.1.1" "token-types": "^5.0.0-alpha.2"
}, },
"engines": { "engines": {
"node": ">=10" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}, },
"funding": { "funding": {
"url": "https://github.com/sindresorhus/file-type?sponsor=1" "url": "https://github.com/sindresorhus/file-type?sponsor=1"
@ -2113,6 +2134,7 @@
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
"dev": true, "dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
@ -2460,6 +2482,7 @@
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
"integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
}, },
@ -2727,12 +2750,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}, },
"node_modules/multimap": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/multimap/-/multimap-1.1.0.tgz",
"integrity": "sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==",
"dev": true
},
"node_modules/nan": { "node_modules/nan": {
"version": "2.15.0", "version": "2.15.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
@ -2838,7 +2855,8 @@
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true "dev": true,
"peer": true
}, },
"node_modules/normalize-package-data": { "node_modules/normalize-package-data": {
"version": "2.5.0", "version": "2.5.0",
@ -3046,11 +3064,11 @@
"dev": true "dev": true
}, },
"node_modules/peek-readable": { "node_modules/peek-readable": {
"version": "4.0.2", "version": "5.0.0-alpha.5",
"resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.0.2.tgz", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0-alpha.5.tgz",
"integrity": "sha512-9fMaz6zoxw9ypO1KZy5RDJgSupEtu0Q+g/OqqsVHX3rKGR8qehRLYzsFARZ4bVvdvfknKiXvuDbkMnO1g6cRpQ==", "integrity": "sha512-pJohF/tDwV3ntnT5+EkUo4E700q/j/OCDuPxtM+5/kFGjyOai/sK4/We4Cy1MB2OiTQliWU5DxPvYIKQAdPqAA==",
"engines": { "engines": {
"node": ">=8" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@ -3142,7 +3160,8 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true "dev": true,
"peer": true
}, },
"node_modules/pluralize": { "node_modules/pluralize": {
"version": "8.0.0", "version": "8.0.0",
@ -3750,31 +3769,6 @@
"url": "https://opencollective.com/libvips" "url": "https://opencollective.com/libvips"
} }
}, },
"node_modules/sharp/node_modules/color": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.0.tgz",
"integrity": "sha512-hHTcrbvEnGjC7WBMk6ibQWFVDgEFTVmjrz2Q5HlU6ltwxv0JJN2Z8I7uRbWeQLF04dikxs8zgyZkazRJvSMtyQ==",
"dependencies": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
}
},
"node_modules/sharp/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/sharp/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/sharp/node_modules/detect-libc": { "node_modules/sharp/node_modules/detect-libc": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
@ -4012,15 +4006,15 @@
} }
}, },
"node_modules/strtok3": { "node_modules/strtok3": {
"version": "6.2.4", "version": "7.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.2.4.tgz", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0-alpha.8.tgz",
"integrity": "sha512-GO8IcFF9GmFDvqduIspUBwCzCbqzegyVKIsSymcMgiZKeCfrN9SowtUoi8+b59WZMAjIzVZic/Ft97+pynR3Iw==", "integrity": "sha512-u+k19v+rTxBjGYxncRQjGvZYwYvEd0uP3D+uHKe/s4WB1eXS5ZwpZsTlBu5xSS4zEd89mTXECXg6WW3FSeV8cA==",
"dependencies": { "dependencies": {
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
"peek-readable": "^4.0.1" "peek-readable": "^5.0.0-alpha.5"
}, },
"engines": { "engines": {
"node": ">=10" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@ -4182,15 +4176,15 @@
} }
}, },
"node_modules/token-types": { "node_modules/token-types": {
"version": "4.1.1", "version": "5.0.0-alpha.2",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-4.1.1.tgz", "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.0-alpha.2.tgz",
"integrity": "sha512-hD+QyuUAyI2spzsI0B7gf/jJ2ggR4RjkAo37j3StuePhApJUwcWDjnHDOFdIWYSwNR28H14hpwm4EI+V1Ted1w==", "integrity": "sha512-EsG9UxAW4M6VATrEEjhPFTKEUi1OiJqTUMIZOGBN49fGxYjZB36k0p7to3HZSmWRoHm1QfZgrg3e02fpqAt5fQ==",
"dependencies": { "dependencies": {
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1" "ieee754": "^1.2.1"
}, },
"engines": { "engines": {
"node": ">=10" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@ -4411,9 +4405,9 @@
} }
}, },
"node_modules/winston": { "node_modules/winston": {
"version": "3.5.0", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/winston/-/winston-3.5.0.tgz", "resolved": "https://registry.npmjs.org/winston/-/winston-3.5.1.tgz",
"integrity": "sha512-OQMbmLsIdVHvm2hSurrYZs+iZNIImXneYJ6pX7LseSMEq20HdTETXiNnNX3FDwN4LB/xDRZLF6JYOY+AI112Kw==", "integrity": "sha512-tbRtVy+vsSSCLcZq/8nXZaOie/S2tPXPFt4be/Q3vI/WtYwm7rrwidxVw2GRa38FIXcJ1kUM6MOZ9Jmnk3F3UA==",
"dependencies": { "dependencies": {
"@dabh/diagnostics": "^2.0.2", "@dabh/diagnostics": "^2.0.2",
"async": "^3.2.3", "async": "^3.2.3",
@ -4733,13 +4727,15 @@
"version": "7.16.8", "version": "7.16.8",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz",
"integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==",
"dev": true "dev": true,
"peer": true
}, },
"@babel/core": { "@babel/core": {
"version": "7.16.12", "version": "7.16.12",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz",
"integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/code-frame": "^7.16.7", "@babel/code-frame": "^7.16.7",
"@babel/generator": "^7.16.8", "@babel/generator": "^7.16.8",
@ -4803,6 +4799,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz",
"integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/compat-data": "^7.16.4", "@babel/compat-data": "^7.16.4",
"@babel/helper-validator-option": "^7.16.7", "@babel/helper-validator-option": "^7.16.7",
@ -4877,6 +4874,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
"integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/types": "^7.16.7" "@babel/types": "^7.16.7"
} }
@ -4886,6 +4884,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz",
"integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-environment-visitor": "^7.16.7",
"@babel/helper-module-imports": "^7.16.7", "@babel/helper-module-imports": "^7.16.7",
@ -4930,6 +4929,7 @@
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz",
"integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/types": "^7.16.7" "@babel/types": "^7.16.7"
} }
@ -4953,13 +4953,15 @@
"version": "7.16.7", "version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
"integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
"dev": true "dev": true,
"peer": true
}, },
"@babel/helpers": { "@babel/helpers": {
"version": "7.16.7", "version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz",
"integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"@babel/template": "^7.16.7", "@babel/template": "^7.16.7",
"@babel/traverse": "^7.16.7", "@babel/traverse": "^7.16.7",
@ -5337,6 +5339,7 @@
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"caniuse-lite": "^1.0.30001286", "caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17", "electron-to-chromium": "^1.4.17",
@ -5407,10 +5410,11 @@
"integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8="
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001303", "version": "1.0.30001304",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001303.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz",
"integrity": "sha512-/Mqc1oESndUNszJP0kx0UaQU9kEv9nNtJ7Kn8AdA0mNnH8eR1cj0kG+NbNuC1Wq/b21eA8prhKRA3bbkjONegQ==", "integrity": "sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ==",
"dev": true "dev": true,
"peer": true
}, },
"chainsaw": { "chainsaw": {
"version": "0.1.0", "version": "0.1.0",
@ -5529,12 +5533,27 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
}, },
"color": { "color": {
"version": "3.2.1", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "resolved": "https://registry.npmjs.org/color/-/color-4.2.0.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "integrity": "sha512-hHTcrbvEnGjC7WBMk6ibQWFVDgEFTVmjrz2Q5HlU6ltwxv0JJN2Z8I7uRbWeQLF04dikxs8zgyZkazRJvSMtyQ==",
"requires": { "requires": {
"color-convert": "^1.9.3", "color-convert": "^2.0.1",
"color-string": "^1.6.0" "color-string": "^1.9.0"
},
"dependencies": {
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}
} }
}, },
"color-convert": { "color-convert": {
@ -5571,6 +5590,17 @@
"requires": { "requires": {
"color": "^3.1.3", "color": "^3.1.3",
"text-hex": "1.0.x" "text-hex": "1.0.x"
},
"dependencies": {
"color": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
"requires": {
"color-convert": "^1.9.3",
"color-string": "^1.6.0"
}
}
} }
}, },
"concat-map": { "concat-map": {
@ -5588,6 +5618,7 @@
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
"integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"safe-buffer": "~5.1.1" "safe-buffer": "~5.1.1"
} }
@ -5694,9 +5725,9 @@
} }
}, },
"dotenv": { "dotenv": {
"version": "10.0.0", "version": "15.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-15.0.0.tgz",
"integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" "integrity": "sha512-/l1sXXm79ry34KwwS0y4oVZjB468iw/6u9g1W26dtexKcIJAnVL2pMF+hxQwzZ7LutxOwEgtym9eIxvX33CMKg=="
}, },
"duplexer2": { "duplexer2": {
"version": "0.1.4", "version": "0.1.4",
@ -5736,10 +5767,11 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.4.57", "version": "1.4.58",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.57.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.58.tgz",
"integrity": "sha512-FNC+P5K1n6pF+M0zIK+gFCoXcJhhzDViL3DRIGy2Fv5PohuSES1JHR7T+GlwxSxlzx4yYbsuzCZvHxcBSRCIOw==", "integrity": "sha512-7LXwnKyqcEaMFVXOer+2JPfFs1D+ej7yRRrfZoIH1YlLQZ81OvBNwSCBBLtExVkoMQQgOWwO0FbZVge6U/8rhQ==",
"dev": true "dev": true,
"peer": true
}, },
"emoji-regex": { "emoji-regex": {
"version": "10.0.0", "version": "10.0.0",
@ -5802,7 +5834,8 @@
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"dev": true "dev": true,
"peer": true
}, },
"escape-string-regexp": { "escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
@ -5948,23 +5981,22 @@
} }
}, },
"eslint-plugin-unicorn": { "eslint-plugin-unicorn": {
"version": "38.0.1", "version": "40.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-38.0.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-40.1.0.tgz",
"integrity": "sha512-eu4HCg7Bv43nk/hYZoWpLzRo668Nb7swQySn94aohn0heh9KLJ1GOFgVxJndLS8BploMGaClxgsyTNGJrP69yw==", "integrity": "sha512-y5doK2DF9Sr5AqKEHbHxjFllJ167nKDRU01HDcWyv4Tnmaoe9iNxMrBnaybZvWZUaE3OC5Unu0lNIevYamloig==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.14.9", "@babel/helper-validator-identifier": "^7.15.7",
"ci-info": "^3.2.0", "ci-info": "^3.3.0",
"clean-regexp": "^1.0.0", "clean-regexp": "^1.0.0",
"eslint-template-visitor": "^2.3.2",
"eslint-utils": "^3.0.0", "eslint-utils": "^3.0.0",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"indent-string": "4", "indent-string": "^4.0.0",
"is-builtin-module": "^3.1.0", "is-builtin-module": "^3.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"read-pkg-up": "^7.0.1", "read-pkg-up": "^7.0.1",
"regexp-tree": "^0.1.23", "regexp-tree": "^0.1.24",
"safe-regex": "^2.1.1", "safe-regex": "^2.1.1",
"semver": "^7.3.5", "semver": "^7.3.5",
"strip-indent": "^3.0.0" "strip-indent": "^3.0.0"
@ -5997,19 +6029,6 @@
"estraverse": "^4.1.1" "estraverse": "^4.1.1"
} }
}, },
"eslint-template-visitor": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/eslint-template-visitor/-/eslint-template-visitor-2.3.2.tgz",
"integrity": "sha512-3ydhqFpuV7x1M9EK52BPNj6V0Kwu0KKkcIAfpUhwHbR8ocRln/oUHgfxQupY8O1h4Qv/POHDumb/BwwNfxbtnA==",
"dev": true,
"requires": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"eslint-visitor-keys": "^2.0.0",
"esquery": "^1.3.1",
"multimap": "^1.1.0"
}
},
"eslint-utils": { "eslint-utils": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
@ -6137,13 +6156,13 @@
} }
}, },
"file-type": { "file-type": {
"version": "16.5.3", "version": "17.1.1",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.3.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.1.tgz",
"integrity": "sha512-uVsl7iFhHSOY4bEONLlTK47iAHtNsFHWP5YE4xJfZ4rnX7S1Q3wce09XgqSC7E/xh8Ncv/be1lNoyprlUH/x6A==", "integrity": "sha512-heRUMZHby2Qj6wZAA3YHeMlRmZNQTcb6VxctkGmM+mcM6ROQKvHpr7SS6EgdfEhH+s25LDshBjvPx/Ecm+bOVQ==",
"requires": { "requires": {
"readable-web-to-node-stream": "^3.0.0", "readable-web-to-node-stream": "^3.0.2",
"strtok3": "^6.2.4", "strtok3": "^7.0.0-alpha.7",
"token-types": "^4.1.1" "token-types": "^5.0.0-alpha.2"
} }
}, },
"file-uri-to-path": { "file-uri-to-path": {
@ -6281,7 +6300,8 @@
"version": "1.0.0-beta.2", "version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
"dev": true "dev": true,
"peer": true
}, },
"get-caller-file": { "get-caller-file": {
"version": "2.0.5", "version": "2.0.5",
@ -6537,6 +6557,7 @@
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
"integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
"dev": true, "dev": true,
"peer": true,
"requires": { "requires": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
@ -6748,12 +6769,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}, },
"multimap": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/multimap/-/multimap-1.1.0.tgz",
"integrity": "sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==",
"dev": true
},
"nan": { "nan": {
"version": "2.15.0", "version": "2.15.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
@ -6827,7 +6842,8 @@
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true "dev": true,
"peer": true
}, },
"normalize-package-data": { "normalize-package-data": {
"version": "2.5.0", "version": "2.5.0",
@ -6989,9 +7005,9 @@
"dev": true "dev": true
}, },
"peek-readable": { "peek-readable": {
"version": "4.0.2", "version": "5.0.0-alpha.5",
"resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.0.2.tgz", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0-alpha.5.tgz",
"integrity": "sha512-9fMaz6zoxw9ypO1KZy5RDJgSupEtu0Q+g/OqqsVHX3rKGR8qehRLYzsFARZ4bVvdvfknKiXvuDbkMnO1g6cRpQ==" "integrity": "sha512-pJohF/tDwV3ntnT5+EkUo4E700q/j/OCDuPxtM+5/kFGjyOai/sK4/We4Cy1MB2OiTQliWU5DxPvYIKQAdPqAA=="
}, },
"pg": { "pg": {
"version": "8.7.1", "version": "8.7.1",
@ -7059,7 +7075,8 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true "dev": true,
"peer": true
}, },
"pluralize": { "pluralize": {
"version": "8.0.0", "version": "8.0.0",
@ -7529,28 +7546,6 @@
"tunnel-agent": "^0.6.0" "tunnel-agent": "^0.6.0"
}, },
"dependencies": { "dependencies": {
"color": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.0.tgz",
"integrity": "sha512-hHTcrbvEnGjC7WBMk6ibQWFVDgEFTVmjrz2Q5HlU6ltwxv0JJN2Z8I7uRbWeQLF04dikxs8zgyZkazRJvSMtyQ==",
"requires": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"detect-libc": { "detect-libc": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
@ -7721,12 +7716,12 @@
"dev": true "dev": true
}, },
"strtok3": { "strtok3": {
"version": "6.2.4", "version": "7.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.2.4.tgz", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0-alpha.8.tgz",
"integrity": "sha512-GO8IcFF9GmFDvqduIspUBwCzCbqzegyVKIsSymcMgiZKeCfrN9SowtUoi8+b59WZMAjIzVZic/Ft97+pynR3Iw==", "integrity": "sha512-u+k19v+rTxBjGYxncRQjGvZYwYvEd0uP3D+uHKe/s4WB1eXS5ZwpZsTlBu5xSS4zEd89mTXECXg6WW3FSeV8cA==",
"requires": { "requires": {
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
"peek-readable": "^4.0.1" "peek-readable": "^5.0.0-alpha.5"
} }
}, },
"supports-color": { "supports-color": {
@ -7836,9 +7831,9 @@
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
}, },
"token-types": { "token-types": {
"version": "4.1.1", "version": "5.0.0-alpha.2",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-4.1.1.tgz", "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.0-alpha.2.tgz",
"integrity": "sha512-hD+QyuUAyI2spzsI0B7gf/jJ2ggR4RjkAo37j3StuePhApJUwcWDjnHDOFdIWYSwNR28H14hpwm4EI+V1Ted1w==", "integrity": "sha512-EsG9UxAW4M6VATrEEjhPFTKEUi1OiJqTUMIZOGBN49fGxYjZB36k0p7to3HZSmWRoHm1QfZgrg3e02fpqAt5fQ==",
"requires": { "requires": {
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1" "ieee754": "^1.2.1"
@ -8027,9 +8022,9 @@
"integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY="
}, },
"winston": { "winston": {
"version": "3.5.0", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/winston/-/winston-3.5.0.tgz", "resolved": "https://registry.npmjs.org/winston/-/winston-3.5.1.tgz",
"integrity": "sha512-OQMbmLsIdVHvm2hSurrYZs+iZNIImXneYJ6pX7LseSMEq20HdTETXiNnNX3FDwN4LB/xDRZLF6JYOY+AI112Kw==", "integrity": "sha512-tbRtVy+vsSSCLcZq/8nXZaOie/S2tPXPFt4be/Q3vI/WtYwm7rrwidxVw2GRa38FIXcJ1kUM6MOZ9Jmnk3F3UA==",
"requires": { "requires": {
"@dabh/diagnostics": "^2.0.2", "@dabh/diagnostics": "^2.0.2",
"async": "^3.2.3", "async": "^3.2.3",

View file

@ -27,17 +27,17 @@
"@top-gg/sdk": "^3.1.1", "@top-gg/sdk": "^3.1.1",
"cmake-js": "^6.3.0", "cmake-js": "^6.3.0",
"cowsay2": "^2.0.4", "cowsay2": "^2.0.4",
"dotenv": "^10.0.0", "dotenv": "^15.0.0",
"emoji-regex": "^10.0.0", "emoji-regex": "^10.0.0",
"eris": "^0.16.1", "eris": "^0.16.1",
"eris-fleet": "^1.0.0", "eris-fleet": "^1.0.0",
"file-type": "^16.1.0", "file-type": "^17.1.1",
"format-duration": "^1.4.0", "format-duration": "^1.4.0",
"jsqr": "^1.3.1", "jsqr": "^1.3.1",
"lavacord": "^1.1.9", "lavacord": "^1.1.9",
"node-addon-api": "^4.2.0", "node-addon-api": "^4.3.0",
"node-emoji": "^1.10.0", "node-emoji": "^1.10.0",
"node-fetch": "^3.1.1", "node-fetch": "^3.2.0",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"sharp": "^0.29.3", "sharp": "^0.29.3",
"winston": "^3.3.3" "winston": "^3.3.3"
@ -47,7 +47,7 @@
"@babel/eslint-plugin": "^7.13.0", "@babel/eslint-plugin": "^7.13.0",
"@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.13.0",
"eslint": "^8.2.0", "eslint": "^8.2.0",
"eslint-plugin-unicorn": "^38.0.1" "eslint-plugin-unicorn": "^40.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"better-sqlite3": "^7.4.1", "better-sqlite3": "^7.4.1",

View file

@ -1,6 +1,6 @@
import fetch from "node-fetch"; import fetch from "node-fetch";
import fs from "fs"; import fs from "fs";
import fileType from "file-type"; import { fileTypeFromBuffer, fileTypeFromFile } from "file-type";
const formats = ["image/jpeg", "image/png", "image/webp", "image/gif", "video/mp4", "video/webm", "video/quicktime"]; const formats = ["image/jpeg", "image/png", "image/webp", "image/gif", "video/mp4", "video/webm", "video/quicktime"];
@ -12,7 +12,7 @@ export const servers = JSON.parse(fs.readFileSync("./servers.json", { encoding:
export async function getType(image, extraReturnTypes) { export async function getType(image, extraReturnTypes) {
if (!image.startsWith("http")) { if (!image.startsWith("http")) {
const imageType = await fileType.fromFile(image); const imageType = await fileTypeFromFile(image);
if (imageType && formats.includes(imageType.mime)) { if (imageType && formats.includes(imageType.mime)) {
return imageType.mime; return imageType.mime;
} }
@ -36,7 +36,7 @@ export async function getType(image, extraReturnTypes) {
return type; return type;
} }
const imageBuffer = await imageRequest.arrayBuffer(); const imageBuffer = await imageRequest.arrayBuffer();
const imageType = await fileType.fromBuffer(imageBuffer); const imageType = await fileTypeFromBuffer(imageBuffer);
if (imageType && formats.includes(imageType.mime)) { if (imageType && formats.includes(imageType.mime)) {
type = imageType.mime; type = imageType.mime;
} }

View file

@ -2,30 +2,30 @@
import { EventEmitter } from "events"; import { EventEmitter } from "events";
class InteractionCollector extends EventEmitter { class InteractionCollector extends EventEmitter {
constructor(client, message, timeout = 120000) { constructor(client, message, type, timeout = 120000) {
super(); super();
this.message = message; this.message = message;
//this.time = timeout; this.type = type;
this.ended = false; this.ended = false;
this.bot = client; this.bot = client;
this.listener = async (packet) => { this.listener = async (interaction) => {
if (packet.t !== "INTERACTION_CREATE") return; await this.verify(interaction);
await this.verify(packet.d.message, packet.d.data.custom_id, packet.d.id, packet.d.token, packet.d.member ? packet.d.member.user.id : packet.d.user.id);
}; };
this.bot.on("rawWS", this.listener); this.bot.on("interactionCreate", this.listener);
setTimeout(() => this.stop("time"), timeout); setTimeout(() => this.stop("time"), timeout);
} }
async verify(message, interaction, id, token, member) { async verify(interaction) {
if (this.message.id !== message.id) return false; if (!(interaction instanceof this.type)) return false;
this.emit("interaction", interaction, id, token, member); if (this.message.id !== interaction.message.id) return false;
this.emit("interaction", interaction);
return true; return true;
} }
stop(reason) { stop(reason) {
if (this.ended) return; if (this.ended) return;
this.ended = true; this.ended = true;
this.bot.removeListener("rawWS", this.listener); this.bot.removeListener("interactionCreate", this.listener);
this.emit("end", this.collected, reason); this.emit("end", this.collected, reason);
} }
} }

View file

@ -1,6 +1,6 @@
import MessageCollector from "./awaitmessages.js"; import MessageCollector from "./awaitmessages.js";
import InteractionCollector from "./awaitinteractions.js"; import InteractionCollector from "./awaitinteractions.js";
import fetch from "node-fetch"; import { ComponentInteraction } from "eris";
export default async (client, message, pages, timeout = 120000) => { export default async (client, message, pages, timeout = 120000) => {
const manageMessages = message.channel.guild && message.channel.permissionsOf(client.user.id).has("manageMessages") ? true : false; const manageMessages = message.channel.guild && message.channel.permissionsOf(client.user.id).has("manageMessages") ? true : false;
@ -63,36 +63,47 @@ export default async (client, message, pages, timeout = 120000) => {
] ]
}] }]
}; };
const ackOptions = {
method: "POST",
body: "{\"type\":6}",
headers: {
"Content-Type": "application/json"
}
};
let currentPage = await client.createMessage(message.channel.id, Object.assign(pages[page], options, pages.length > 1 ? components : {})); let currentPage = await client.createMessage(message.channel.id, Object.assign(pages[page], options, pages.length > 1 ? components : {}));
if (pages.length > 1) { if (pages.length > 1) {
const interactionCollector = new InteractionCollector(client, currentPage, timeout); const interactionCollector = new InteractionCollector(client, currentPage, ComponentInteraction, timeout);
interactionCollector.on("interaction", async (interaction, id, token, member) => { interactionCollector.on("interaction", async (interaction) => {
if (member === message.author.id) { if ((interaction.member ?? interaction.user).id === message.author.id) {
switch (interaction) { switch (interaction.data.custom_id) {
case "back": case "back":
await fetch(`https://discord.com/api/v9/interactions/${id}/${token}/callback`, ackOptions); await interaction.deferUpdate();
page = page > 0 ? --page : pages.length - 1; page = page > 0 ? --page : pages.length - 1;
currentPage = await currentPage.edit(Object.assign(pages[page], options)); currentPage = await currentPage.edit(Object.assign(pages[page], options));
break; break;
case "forward": case "forward":
await fetch(`https://discord.com/api/v9/interactions/${id}/${token}/callback`, ackOptions); await interaction.deferUpdate();
page = page + 1 < pages.length ? ++page : 0; page = page + 1 < pages.length ? ++page : 0;
currentPage = await currentPage.edit(Object.assign(pages[page], options)); currentPage = await currentPage.edit(Object.assign(pages[page], options));
break; break;
case "jump": case "jump":
await fetch(`https://discord.com/api/v9/interactions/${id}/${token}/callback`, ackOptions); await interaction.deferUpdate();
const newComponents = JSON.parse(JSON.stringify(components)); const newComponents = JSON.parse(JSON.stringify(components));
for (const index of newComponents.components[0].components.keys()) { for (const index of newComponents.components[0].components.keys()) {
newComponents.components[0].components[index].disabled = true; newComponents.components[0].components[index].disabled = true;
} }
currentPage = await currentPage.edit(newComponents); currentPage = await currentPage.edit(newComponents);
const jumpComponents = {
components: [{
type: 1,
components: [{
type: 3,
custom_id: "seekDropdown",
placeholder: "Page Number",
options: []
}]
}]
};
for (let i = 0; i < pages.length; i++) {
const payload = {
label: i + 1,
value: i
};
jumpComponents.components[0].components[0].options[i] = payload;
}
client.createMessage(message.channel.id, Object.assign({ content: "What page do you want to jump to?" }, { client.createMessage(message.channel.id, Object.assign({ content: "What page do you want to jump to?" }, {
messageReference: { messageReference: {
channelID: currentPage.channel.id, channelID: currentPage.channel.id,
@ -103,15 +114,20 @@ export default async (client, message, pages, timeout = 120000) => {
allowedMentions: { allowedMentions: {
repliedUser: false repliedUser: false
} }
})).then(askMessage => { }, jumpComponents)).then(askMessage => {
const messageCollector = new MessageCollector(client, askMessage.channel, (response) => response.author.id === message.author.id && !isNaN(response.content) && Number(response.content) <= pages.length && Number(response.content) > 0, { const dropdownCollector = new InteractionCollector(client, askMessage, ComponentInteraction, timeout);
time: timeout, let ended = false;
maxMatches: 1 dropdownCollector.on("interaction", async (response) => {
}); if (response.data.custom_id !== "seekDropdown") return;
return messageCollector.on("message", async (response) => { if (await client.getMessage(askMessage.channel.id, askMessage.id).catch(() => undefined)) await askMessage.delete();
page = Number(response.data.values[0]);
currentPage = await currentPage.edit(Object.assign(pages[page], options, components));
ended = true;
dropdownCollector.stop();
});
dropdownCollector.once("end", async () => {
if (ended) return;
if (await client.getMessage(askMessage.channel.id, askMessage.id).catch(() => undefined)) await askMessage.delete(); if (await client.getMessage(askMessage.channel.id, askMessage.id).catch(() => undefined)) await askMessage.delete();
if (manageMessages) await response.delete();
page = Number(response.content) - 1;
currentPage = await currentPage.edit(Object.assign(pages[page], options, components)); currentPage = await currentPage.edit(Object.assign(pages[page], options, components));
}); });
}).catch(error => { }).catch(error => {
@ -119,7 +135,7 @@ export default async (client, message, pages, timeout = 120000) => {
}); });
break; break;
case "delete": case "delete":
await fetch(`https://discord.com/api/v9/interactions/${id}/${token}/callback`, ackOptions); await interaction.deferUpdate();
interactionCollector.emit("end"); interactionCollector.emit("end");
if (await client.getMessage(currentPage.channel.id, currentPage.id).catch(() => undefined)) await currentPage.delete(); if (await client.getMessage(currentPage.channel.id, currentPage.id).catch(() => undefined)) await currentPage.delete();
return; return;
@ -130,10 +146,10 @@ export default async (client, message, pages, timeout = 120000) => {
}); });
interactionCollector.once("end", async () => { interactionCollector.once("end", async () => {
interactionCollector.removeAllListeners("interaction"); interactionCollector.removeAllListeners("interaction");
for (const index of components.components[0].components.keys()) {
components.components[0].components[index].disabled = true;
}
if (await client.getMessage(currentPage.channel.id, currentPage.id).catch(() => undefined)) { if (await client.getMessage(currentPage.channel.id, currentPage.id).catch(() => undefined)) {
for (const index of components.components[0].components.keys()) {
components.components[0].components[index].disabled = true;
}
await currentPage.edit(components); await currentPage.edit(components);
} }
}); });