Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ee056680b | |||
| 3c206c7f4b | |||
| d0579d3132 | |||
| bfccc0eac9 | |||
| 81526839cb | |||
| eaa505bfb1 | |||
| d2af03764b | |||
| 0eff5800a4 | |||
| edbd1f14b4 | |||
| ebe41ead9a | |||
| 2b3dd99811 | |||
| 3173a42b92 | |||
| 74dfe18a83 | |||
| b0c0c2344b | |||
| 8892f99ff2 | |||
| d4df7b1417 | |||
| 3fed27d62e | |||
| 7c29ad240f | |||
| bc706930b8 | |||
| d70abc5092 | |||
|
|
cbde2fd537 | ||
| bd0d0e9f2c | |||
| eb2cff2f54 | |||
| 97349ef57b | |||
| 986cc70f8c | |||
| ac57039a3a | |||
| 95b77c765c | |||
| 4e8e83c305 | |||
| dbf1d07a32 |
656
package-lock.json
generated
656
package-lock.json
generated
@ -1,56 +1,52 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.60.5",
|
||||
"version": "3001.62.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "denim_3001",
|
||||
"version": "3001.60.5",
|
||||
"version": "3001.62.9",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@discordjs/voice": "^0.17.0",
|
||||
"discord.js": "^14.16.3",
|
||||
"@discordjs/voice": "^0.19.0",
|
||||
"@distube/ytdl-core": "^4.16.12",
|
||||
"@snazzah/davey": "^0.1.7",
|
||||
"discord.js": "^14.23.2",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
"mysql": "^2.18.1",
|
||||
"opusscript": "^0.1.1",
|
||||
"play-dl": "https://gitea.deadfish.cz/Histmy/play-dl-fix/archive/main.tar.gz",
|
||||
"play-dl": "github:xuc323/play-dl",
|
||||
"tiny-typed-emitter": "^2.1.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"valibot": "^0.42.1"
|
||||
"valibot": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-levenshtein": "^1.1.3",
|
||||
"@types/mysql": "^2.15.26"
|
||||
"@types/mysql": "^2.15.27"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.9.0.tgz",
|
||||
"integrity": "sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==",
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.12.2.tgz",
|
||||
"integrity": "sha512-AugKmrgRJOHXEyMkABH/hXpAmIBKbYokCEl9VAM4Kh6FvkdobQ+Zhv7AR6K+y5hS7+VQ7gKXPYCe1JQmV07H1g==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@discordjs/formatters": "^0.5.0",
|
||||
"@discordjs/formatters": "^0.6.1",
|
||||
"@discordjs/util": "^1.1.1",
|
||||
"@sapphire/shapeshift": "^4.0.0",
|
||||
"discord-api-types": "0.37.97",
|
||||
"discord-api-types": "^0.38.26",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"ts-mixer": "^6.0.4",
|
||||
"tslib": "^2.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=16.11.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
|
||||
"version": "0.37.97",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz",
|
||||
"integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@discordjs/collection": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz",
|
||||
@ -61,30 +57,24 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/formatters": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.5.0.tgz",
|
||||
"integrity": "sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==",
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.1.tgz",
|
||||
"integrity": "sha512-5cnX+tASiPCqCWtFcFslxBVUaCetB0thvM/JyavhbXInP1HJIEU+Qv/zMrnuwSsX3yWH2lVXNJZeDK3EiP4HHg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"discord-api-types": "0.37.97"
|
||||
"discord-api-types": "^0.38.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=16.11.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/formatters/node_modules/discord-api-types": {
|
||||
"version": "0.37.97",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz",
|
||||
"integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@discordjs/rest": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.4.0.tgz",
|
||||
"integrity": "sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.6.0.tgz",
|
||||
"integrity": "sha512-RDYrhmpB7mTvmCKcpj+pc5k7POKszS4E2O9TYc+U+Y4iaCP+r910QdO43qmpOja8LRr1RJ0b3U+CqVsnPqzf4w==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@discordjs/collection": "^2.1.1",
|
||||
@ -92,10 +82,10 @@
|
||||
"@sapphire/async-queue": "^1.5.3",
|
||||
"@sapphire/snowflake": "^3.5.3",
|
||||
"@vladfrangu/async_event_emitter": "^2.4.6",
|
||||
"discord-api-types": "0.37.97",
|
||||
"discord-api-types": "^0.38.16",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"tslib": "^2.6.3",
|
||||
"undici": "6.19.8"
|
||||
"undici": "6.21.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
@ -116,11 +106,14 @@
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/rest/node_modules/discord-api-types": {
|
||||
"version": "0.37.97",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz",
|
||||
"integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==",
|
||||
"license": "MIT"
|
||||
"node_modules/@discordjs/rest/node_modules/undici": {
|
||||
"version": "6.21.3",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz",
|
||||
"integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/util": {
|
||||
"version": "1.1.1",
|
||||
@ -135,19 +128,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/voice": {
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.17.0.tgz",
|
||||
"integrity": "sha512-hArn9FF5ZYi1IkxdJEVnJi+OxlwLV0NJYWpKXsmNOojtGtAZHxmsELA+MZlu2KW1F/K1/nt7lFOfcMXNYweq9w==",
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.19.0.tgz",
|
||||
"integrity": "sha512-UyX6rGEXzVyPzb1yvjHtPfTlnLvB5jX/stAMdiytHhfoydX+98hfympdOwsnTktzr+IRvphxTbdErgYDJkEsvw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@types/ws": "^8.5.10",
|
||||
"discord-api-types": "0.37.83",
|
||||
"@types/ws": "^8.18.1",
|
||||
"discord-api-types": "^0.38.16",
|
||||
"prism-media": "^1.3.5",
|
||||
"tslib": "^2.6.2",
|
||||
"ws": "^8.16.0"
|
||||
"tslib": "^2.8.1",
|
||||
"ws": "^8.18.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.11.0"
|
||||
"node": ">=22.12.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
@ -188,20 +181,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/ws": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.1.1.tgz",
|
||||
"integrity": "sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==",
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.3.tgz",
|
||||
"integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@discordjs/collection": "^2.1.0",
|
||||
"@discordjs/rest": "^2.3.0",
|
||||
"@discordjs/rest": "^2.5.1",
|
||||
"@discordjs/util": "^1.1.0",
|
||||
"@sapphire/async-queue": "^1.5.2",
|
||||
"@types/ws": "^8.5.10",
|
||||
"@vladfrangu/async_event_emitter": "^2.2.4",
|
||||
"discord-api-types": "0.37.83",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"tslib": "^2.6.2",
|
||||
"ws": "^8.16.0"
|
||||
"ws": "^8.17.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.11.0"
|
||||
@ -222,10 +215,74 @@
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/@distube/ytdl-core": {
|
||||
"version": "4.16.12",
|
||||
"resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.16.12.tgz",
|
||||
"integrity": "sha512-/NR8Jur1Q4E2oD+DJta7uwWu7SkqdEkhwERt7f4iune70zg7ZlLLTOHs1+jgg3uD2jQjpdk7RGC16FqstG4RsA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"http-cookie-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"m3u8stream": "^0.8.6",
|
||||
"miniget": "^4.2.3",
|
||||
"sax": "^1.4.1",
|
||||
"tough-cookie": "^5.1.2",
|
||||
"undici": "^7.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.18.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/distubejs/ytdl-core?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/core": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.6.0.tgz",
|
||||
"integrity": "sha512-zq/ay+9fNIJJtJiZxdTnXS20PllcYMX3OE23ESc4HK/bdYu3cOWYVhsOhVnXALfU/uqJIxn5NBPd9z4v+SfoSg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emnapi/wasi-threads": "1.1.0",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/runtime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.6.0.tgz",
|
||||
"integrity": "sha512-obtUmAHTMjll499P+D9A3axeJFlhdjOWdKUNs/U6QIGT7V5RjcUW1xToAzjvmgTSQhDbYn/NwfTRoJcQ2rNBxA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/wasi-threads": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz",
|
||||
"integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz",
|
||||
"integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emnapi/core": "^1.5.0",
|
||||
"@emnapi/runtime": "^1.5.0",
|
||||
"@tybys/wasm-util": "^0.10.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@sapphire/async-queue": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.3.tgz",
|
||||
"integrity": "sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w==",
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz",
|
||||
"integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
@ -255,6 +312,268 @@
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey/-/davey-0.1.7.tgz",
|
||||
"integrity": "sha512-qBWp9sHf9vvKqDhg2AGOgWjB9q7MZat2CAPIcaXe+XFWl7nCmriRnDcdIRy7CwKWK+ECiuO29/RSxxKuulo28w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/Snazzah"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@snazzah/davey-android-arm-eabi": "0.1.7",
|
||||
"@snazzah/davey-android-arm64": "0.1.7",
|
||||
"@snazzah/davey-darwin-arm64": "0.1.7",
|
||||
"@snazzah/davey-darwin-x64": "0.1.7",
|
||||
"@snazzah/davey-freebsd-x64": "0.1.7",
|
||||
"@snazzah/davey-linux-arm-gnueabihf": "0.1.7",
|
||||
"@snazzah/davey-linux-arm64-gnu": "0.1.7",
|
||||
"@snazzah/davey-linux-arm64-musl": "0.1.7",
|
||||
"@snazzah/davey-linux-x64-gnu": "0.1.7",
|
||||
"@snazzah/davey-linux-x64-musl": "0.1.7",
|
||||
"@snazzah/davey-wasm32-wasi": "0.1.7",
|
||||
"@snazzah/davey-win32-arm64-msvc": "0.1.7",
|
||||
"@snazzah/davey-win32-ia32-msvc": "0.1.7",
|
||||
"@snazzah/davey-win32-x64-msvc": "0.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-android-arm-eabi": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm-eabi/-/davey-android-arm-eabi-0.1.7.tgz",
|
||||
"integrity": "sha512-GxkEpfFtaS8xZHN42NkTQhLFdYCQ9qxJvmG+qwYDL+wdv3s7Dl44o2lg5gwGOtQU8EZw9/lZkYi9TenYkStbFg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-android-arm64": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm64/-/davey-android-arm64-0.1.7.tgz",
|
||||
"integrity": "sha512-EkC1Wz3IMBZfbaCE82+peV+vEFVCRL3HxTRKGIY5AXzkKGQSJJ7Est/6h9vTcQbBEbMj2RAXRbwcydukWJR2vg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-darwin-arm64": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-arm64/-/davey-darwin-arm64-0.1.7.tgz",
|
||||
"integrity": "sha512-Iov5NUjhl5Q9XZHIuGLzd9PgQPm8ELI9NPiNt3r6VtSVHLp9/ktOgzaeEji0WnvvirrSb9MdpfTuyHnJjEXuRQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-darwin-x64": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-x64/-/davey-darwin-x64-0.1.7.tgz",
|
||||
"integrity": "sha512-P7WqV/9ttSW2kHlC1WME8ykMeo0LJBzqbC9lZ2aYH4IEdb5mp4lCzb82mcEc99Nxi8878c0k5Qaza6z4KeSdIA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-freebsd-x64": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-freebsd-x64/-/davey-freebsd-x64-0.1.7.tgz",
|
||||
"integrity": "sha512-O8QxS4jGPCvvHa5EJIvP0Dm2JkMqe1RnfDU0qnIcSwzJseqQqwpM5vXSMt9E2Mi58RiUGwTRefr0I9+ttCrDzg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm-gnueabihf": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm-gnueabihf/-/davey-linux-arm-gnueabihf-0.1.7.tgz",
|
||||
"integrity": "sha512-30Gzhbg7kBbbg/Vdb75c5DUvHrwRglIXtTK0L3paxo5TCNXNFdfnSX5oLGjV4s1pyoFL8nWyq3/IzCcUIcHx5Q==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm64-gnu": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-gnu/-/davey-linux-arm64-gnu-0.1.7.tgz",
|
||||
"integrity": "sha512-kDpbZEb24bn84yDG7gG8KTLL1sTl+UHPEt83qD5G3Sm7L37DN+uABN4nw51wst1JzxWphq7tvSSjfqz9NES4Xg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm64-musl": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-musl/-/davey-linux-arm64-musl-0.1.7.tgz",
|
||||
"integrity": "sha512-J+6CnJ34OaoFYq9f8BQPSXWMF3HRjKg5UCEb0E64Q7wMz5+6o7hACd7kVjKnG3as7IjGMcgp6/SNtrht79ntjQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-x64-gnu": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-gnu/-/davey-linux-x64-gnu-0.1.7.tgz",
|
||||
"integrity": "sha512-7+I6LN43WkALjrQGm/pp1fQg84pSnwicsLPZKthlEi1L2UP2d9k8JEtnhHXJ4pymLuPsAZu5nC8QMDoIJy+exw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-x64-musl": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-musl/-/davey-linux-x64-musl-0.1.7.tgz",
|
||||
"integrity": "sha512-N17vBRkU401w8EOvHVem2di/zAqv3CDgm7LAnONm8S/CNpAeLQWrhbHdN6RHZEyhQk2trnfPh4+wiZbAoXek0A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-wasm32-wasi": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-wasm32-wasi/-/davey-wasm32-wasi-0.1.7.tgz",
|
||||
"integrity": "sha512-BhtNJpqmP69sdSf5eyDqlIsZSjkHo6FebaXaYVH0qf3V9YYQdEbbjep3MrcIL2F0STfpceSi2v+vZTTwlZBbKw==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@napi-rs/wasm-runtime": "^1.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-arm64-msvc": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-arm64-msvc/-/davey-win32-arm64-msvc-0.1.7.tgz",
|
||||
"integrity": "sha512-oj/F1eQRQggMwqXNq6CY4UTqcFcCi/Wug99jWH8LepLVsYUdFxQUNTqkp51qarT+lbuX4L/ZZqZX4y4dhz6Lvg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-ia32-msvc": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-ia32-msvc/-/davey-win32-ia32-msvc-0.1.7.tgz",
|
||||
"integrity": "sha512-T1qPP/pQm0qDaM7QGCYMzeXE1Xes0b3ckAQS2m27dt3FkD1Ki8FX2g77dcGOWqGkzDlNJj1drw/9QlgCt3Tcrw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-x64-msvc": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-x64-msvc/-/davey-win32-x64-msvc-0.1.7.tgz",
|
||||
"integrity": "sha512-Z2NhImUYeApi/lNn7MBcn14dPa2dtgnp5taz43JDaPpl+2cinDm9kYjpFzJE9SZMlfsa//p2dhE9B8TEVi9bHQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
|
||||
"integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -263,9 +582,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/mysql": {
|
||||
"version": "2.15.26",
|
||||
"resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz",
|
||||
"integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==",
|
||||
"version": "2.15.27",
|
||||
"resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz",
|
||||
"integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -282,24 +601,33 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.5.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz",
|
||||
"integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==",
|
||||
"version": "8.18.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
|
||||
"integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@vladfrangu/async_event_emitter": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.6.tgz",
|
||||
"integrity": "sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==",
|
||||
"version": "2.4.7",
|
||||
"resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.7.tgz",
|
||||
"integrity": "sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz",
|
||||
"integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/bignumber.js": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
|
||||
@ -315,30 +643,51 @@
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/discord-api-types": {
|
||||
"version": "0.37.83",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.83.tgz",
|
||||
"integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==",
|
||||
"license": "MIT"
|
||||
"version": "0.38.30",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.30.tgz",
|
||||
"integrity": "sha512-KhAqlBrg+rVK+Ob7INMF5o63yW4/GUzRatG/AjyVsIO8lgcLyR8qCl2HokIVzWwmzkJYG0CEPXsKMOqau3E8NA==",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"scripts/actions/documentation"
|
||||
]
|
||||
},
|
||||
"node_modules/discord.js": {
|
||||
"version": "14.16.3",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.3.tgz",
|
||||
"integrity": "sha512-EPCWE9OkA9DnFFNrO7Kl1WHHDYFXu3CNVFJg63bfU7hVtjZGyhShwZtSBImINQRWxWP2tgo2XI+QhdXx28r0aA==",
|
||||
"version": "14.23.2",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.23.2.tgz",
|
||||
"integrity": "sha512-tU2NFr823X3TXEc8KyR/4m296KLxPai4nirN3q9kHCpY4TKj96n9lHZnyLzRNMui8EbL07jg9hgH2PWWfKMGIg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@discordjs/builders": "^1.9.0",
|
||||
"@discordjs/builders": "^1.12.1",
|
||||
"@discordjs/collection": "1.5.3",
|
||||
"@discordjs/formatters": "^0.5.0",
|
||||
"@discordjs/rest": "^2.4.0",
|
||||
"@discordjs/formatters": "^0.6.1",
|
||||
"@discordjs/rest": "^2.6.0",
|
||||
"@discordjs/util": "^1.1.1",
|
||||
"@discordjs/ws": "1.1.1",
|
||||
"@discordjs/ws": "^1.2.3",
|
||||
"@sapphire/snowflake": "3.5.3",
|
||||
"discord-api-types": "0.37.100",
|
||||
"discord-api-types": "^0.38.29",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"lodash.snakecase": "4.1.1",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"tslib": "^2.6.3",
|
||||
"undici": "6.19.8"
|
||||
"undici": "6.21.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
@ -347,11 +696,14 @@
|
||||
"url": "https://github.com/discordjs/discord.js?sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/discord.js/node_modules/discord-api-types": {
|
||||
"version": "0.37.100",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.100.tgz",
|
||||
"integrity": "sha512-a8zvUI0GYYwDtScfRd/TtaNBDTXwP5DiDVX7K5OmE+DRT57gBqKnwtOC5Ol8z0mRW8KQfETIgiB8U0YZ9NXiCA==",
|
||||
"license": "MIT"
|
||||
"node_modules/discord.js/node_modules/undici": {
|
||||
"version": "6.21.3",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz",
|
||||
"integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
@ -359,6 +711,43 @@
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/http-cookie-agent": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-cookie-agent/-/http-cookie-agent-7.0.1.tgz",
|
||||
"integrity": "sha512-lZHFZUdPTw64PdksQac5xbUd4NWjUbyDYnvR//2sbLpcC4UqEUW0x/6O+rDntVzJzJ07QvhtL5XZSC+c5EK+IQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^7.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/3846masa"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tough-cookie": "^4.0.0 || ^5.0.0",
|
||||
"undici": "^7.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"undici": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
|
||||
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^7.1.2",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
@ -392,10 +781,38 @@
|
||||
"integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/m3u8stream": {
|
||||
"version": "0.8.6",
|
||||
"resolved": "https://registry.npmjs.org/m3u8stream/-/m3u8stream-0.8.6.tgz",
|
||||
"integrity": "sha512-LZj8kIVf9KCphiHmH7sbFQTVe4tOemb202fWwvJwR9W5ENW/1hxJN6ksAWGhQgSBSa3jyWhnjKU1Fw1GaOdbyA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"miniget": "^4.2.2",
|
||||
"sax": "^1.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/magic-bytes.js": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz",
|
||||
"integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==",
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.12.1.tgz",
|
||||
"integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/miniget": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/miniget/-/miniget-4.2.3.tgz",
|
||||
"integrity": "sha512-SjbDPDICJ1zT+ZvQwK0hUcRY4wxlhhNpHL9nJOB2MEAXRGagTljsO8MEDzQMTFf0Q8g4QNi8P9lEm/g7e+qgzA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mysql": {
|
||||
@ -427,8 +844,7 @@
|
||||
},
|
||||
"node_modules/play-dl": {
|
||||
"version": "1.9.7",
|
||||
"resolved": "https://gitea.deadfish.cz/Histmy/play-dl-fix/archive/main.tar.gz",
|
||||
"integrity": "sha512-YK62RESrfcOXJAE7orKb+D+vs7lJvRur7hq1vPeT4pFH2aJSjI4sGgoefRYDPoM/BCp8VCsC5i11YDpWbW2dMA==",
|
||||
"resolved": "git+ssh://git@github.com/xuc323/play-dl.git#2e515a99b7f872b1670ad7d23455fd7a05a07b3e",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"play-audio": "^0.5.2"
|
||||
@ -464,6 +880,12 @@
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
|
||||
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/sqlstring": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz",
|
||||
@ -488,6 +910,36 @@
|
||||
"integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tldts": {
|
||||
"version": "6.1.86",
|
||||
"resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz",
|
||||
"integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tldts-core": "^6.1.86"
|
||||
},
|
||||
"bin": {
|
||||
"tldts": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/tldts-core": {
|
||||
"version": "6.1.86",
|
||||
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz",
|
||||
"integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tough-cookie": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz",
|
||||
"integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"tldts": "^6.1.32"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-mixer": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz",
|
||||
@ -495,9 +947,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
|
||||
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/tweetnacl": {
|
||||
@ -507,12 +959,12 @@
|
||||
"license": "Unlicense"
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.19.8",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz",
|
||||
"integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==",
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-7.9.0.tgz",
|
||||
"integrity": "sha512-e696y354tf5cFZPXsF26Yg+5M63+5H3oE6Vtkh2oqbvsE2Oe7s2nIbcQh5lmG7Lp/eS29vJtTpw9+p6PX0qNSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
"node": ">=20.18.1"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
@ -528,9 +980,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/valibot": {
|
||||
"version": "0.42.1",
|
||||
"resolved": "https://registry.npmjs.org/valibot/-/valibot-0.42.1.tgz",
|
||||
"integrity": "sha512-3keXV29Ar5b//Hqi4MbSdV7lfVp6zuYLZuA9V1PvQUsXqogr+u5lvLPLk3A4f74VUXDnf/JfWMN6sB+koJ/FFw==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/valibot/-/valibot-1.1.0.tgz",
|
||||
"integrity": "sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"typescript": ">=5"
|
||||
@ -542,9 +994,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.18.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
|
||||
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
|
||||
"version": "8.18.3",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
|
||||
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
|
||||
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.60.5",
|
||||
"version": "3001.62.9",
|
||||
"description": "Toto je velmi kvalitní bot.",
|
||||
"repository": {
|
||||
"url": "https://github.com/Histmy/Denim-Bot/"
|
||||
@ -13,18 +13,20 @@
|
||||
"author": "Histmy + det-fys",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@discordjs/voice": "^0.17.0",
|
||||
"discord.js": "^14.16.3",
|
||||
"@discordjs/voice": "^0.19.0",
|
||||
"@distube/ytdl-core": "^4.16.12",
|
||||
"@snazzah/davey": "^0.1.7",
|
||||
"discord.js": "^14.23.2",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
"mysql": "^2.18.1",
|
||||
"opusscript": "^0.1.1",
|
||||
"play-dl": "https://gitea.deadfish.cz/Histmy/play-dl-fix/archive/main.tar.gz",
|
||||
"play-dl": "github:xuc323/play-dl",
|
||||
"tiny-typed-emitter": "^2.1.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"valibot": "^0.42.1"
|
||||
"valibot": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-levenshtein": "^1.1.3",
|
||||
"@types/mysql": "^2.15.26"
|
||||
"@types/mysql": "^2.15.27"
|
||||
}
|
||||
}
|
||||
|
||||
40
res/sachy/game.html
Normal file
40
res/sachy/game.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Hra - $domena</title>
|
||||
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nic {
|
||||
width: 2em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Hra</h1>
|
||||
|
||||
<p>$pecko</p>
|
||||
|
||||
<table>
|
||||
$hra
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
84
src/app.ts
84
src/app.ts
@ -1,11 +1,10 @@
|
||||
import { ButtonStyle, ChannelType, Client, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials } from "discord.js";
|
||||
import { ButtonStyle, ChannelType, Client, ClientPresenceStatusData, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials, Presence } from "discord.js";
|
||||
import { readdirSync } from "fs";
|
||||
import { CClient, CUser, HelpServer, Komand, KomandNaExport, KomandRaw, ListenerFunkce, Modul, SMessage, SRecord, SuperListenerFunkce } from "./utils/types";
|
||||
import { adminLog, areStatusesSame, formatCas, log, nabidni, oddiakritikovat, prefix, rand, send } from "./utils/utils.js";
|
||||
import { adminLog, areStatusesSame, formatCas, log, nabidni, oddiakritikovat, prefix, rand, messageReply } from "./utils/utils.js";
|
||||
import levenshtein from "js-levenshtein";
|
||||
import { emouty } from "./utils/emotes";
|
||||
import { lidiCoMajDenimPremium, setClient } from "./utils/denim-Spravce";
|
||||
import { logOOoZS, logSZS, logPZS } from "./utils/statuslog";
|
||||
|
||||
const ints = GatewayIntentBits;
|
||||
const client = new Client({
|
||||
@ -21,7 +20,7 @@ const komandyNaPoslani: KomandNaExport[] = [];
|
||||
const helpServer: HelpServer = require("./utils/helpServer");
|
||||
|
||||
client.on("error", err => {
|
||||
log(err);
|
||||
log("errorek", err);
|
||||
adminLog(client, "nejaka chyba na klijentovi", err);
|
||||
});
|
||||
|
||||
@ -30,6 +29,39 @@ client.on("shardError", err => {
|
||||
adminLog(client, "šárd ejrr??", err);
|
||||
});
|
||||
|
||||
process.on("unhandledRejection", (reason, promise) => {
|
||||
let message: string;
|
||||
|
||||
if (reason instanceof Error) {
|
||||
message = `${reason.name}: ${reason.message}\n${reason.stack}`;
|
||||
} else {
|
||||
message = String(reason);
|
||||
}
|
||||
|
||||
if (message.includes("Connect Timeout Error") && message.includes("10000ms")) {
|
||||
// Klasika
|
||||
log(new Error("Discord timeout..."));
|
||||
return;
|
||||
}
|
||||
|
||||
log(new Error("Unhandled Rejection in app:"), reason, promise);
|
||||
|
||||
adminLog(client, "Unhandled Rejection", message);
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (err) => {
|
||||
log(new Error("Uncaught Exception in app:"), err);
|
||||
|
||||
let message: string;
|
||||
if (err instanceof Error) {
|
||||
message = `${err.name}: ${err.message}\n${err.stack}`;
|
||||
} else {
|
||||
message = String(err);
|
||||
}
|
||||
|
||||
adminLog(client, "Uncaught Exception", message);
|
||||
});
|
||||
|
||||
client.komandy = {};
|
||||
client.aliasy = {};
|
||||
setClient(client);
|
||||
@ -230,7 +262,7 @@ function handle(e: unknown, mesOrInt: SMessage | CommandInteraction) {
|
||||
const admin = process.env.adminID;
|
||||
|
||||
const txt = `pri spousteni thohoto komandu nastala chyba ${admin ? `<@${admin}> uz?` : ""}`;
|
||||
if (mesOrInt instanceof Message) return void send(mesOrInt, txt);
|
||||
if (mesOrInt instanceof Message) return void messageReply(mesOrInt, txt);
|
||||
mesOrInt.reply(txt);
|
||||
}
|
||||
|
||||
@ -242,23 +274,23 @@ async function runKomand(mesOrInt: SMessage | CommandInteraction, cmd: Komand, c
|
||||
if (jeMes && cmd.slashRun) {
|
||||
const nazev = `${prefix}${cmdName}`;
|
||||
const id = client.slashCommandy[nazev];
|
||||
return void send(mesOrInt, `tuto ejenom sleh komand </${nazev}:${id}>`);
|
||||
return void messageReply(mesOrInt, `tuto ejenom sleh komand </${nazev}:${id}>`);
|
||||
}
|
||||
|
||||
if (cmd.cd && jeMes) {
|
||||
const zbyva = Math.round(maKuldan(mesOrInt.author.id, cmdName, cmd.cd));
|
||||
if (zbyva) return send(mesOrInt, `si kkt vole maz kuldan jeste ${formatCas(zbyva)}`);
|
||||
if (zbyva) return messageReply(mesOrInt, `si kkt vole maz kuldan jeste ${formatCas(zbyva)}`);
|
||||
}
|
||||
|
||||
if (cmd.premium && !lidiCoMajDenimPremium.includes(jeMes ? mesOrInt.author.id : mesOrInt.member?.user.id || "")) {
|
||||
return send(mesOrInt as SMessage, "sorka bracho tuto je koamnd jenom pro curaki co platy");
|
||||
return messageReply(mesOrInt as SMessage, "sorka bracho tuto je koamnd jenom pro curaki co platy");
|
||||
}
|
||||
|
||||
const akce = cmd.run ?? cmd.slashRun!;
|
||||
|
||||
if (typeof akce == "string") {
|
||||
const res = renderMessage(akce, arg?.split(" ") || []);
|
||||
if (jeMes) return send(mesOrInt, res);
|
||||
if (jeMes) return messageReply(mesOrInt, res);
|
||||
return mesOrInt.reply(res);
|
||||
}
|
||||
|
||||
@ -267,7 +299,7 @@ async function runKomand(mesOrInt: SMessage | CommandInteraction, cmd: Komand, c
|
||||
const result = await akce(mesOrInt as never, arg || "");
|
||||
if (!result) return;
|
||||
|
||||
if (jeMes) return send(mesOrInt, result)
|
||||
if (jeMes) return messageReply(mesOrInt, result)
|
||||
.catch(e => handle(e, mesOrInt));
|
||||
// další feklo
|
||||
mesOrInt.reply(result as InteractionReplyOptions);
|
||||
@ -283,12 +315,12 @@ client.on("messageCreate", async mes => {
|
||||
|
||||
const prefixDiff = levenshtein(oddiakritikovat(mesPrefix.toLowerCase()), prefix);
|
||||
if (prefixDiff > 0) {
|
||||
if (!await runEvent("messageCreate", [mes]) && prefixDiff <= 1 && mes.author.id != client.user!.id) send(mes, `${prefix}*`);
|
||||
if (!await runEvent("messageCreate", [mes]) && prefixDiff <= 1 && mes.author.id != client.user!.id) messageReply(mes, `${prefix}*`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!komandSDiakritikou) {
|
||||
if (!await runEvent("messageCreate", [mes])) send(mes, "coe voe");
|
||||
if (!await runEvent("messageCreate", [mes])) messageReply(mes, "coe voe");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -307,7 +339,7 @@ client.on("messageCreate", async mes => {
|
||||
if (await runEvent("messageCreate", [mes, cmdName])) return;
|
||||
|
||||
const komand = client.komandy[cmdName];
|
||||
if (mes.channel.type == ChannelType.DM && komand?.DMUnsafe) return void send(mes, "tuten komand bohuzel v sz nefunkuje");
|
||||
if (mes.channel.type == ChannelType.DM && komand?.DMUnsafe) return void messageReply(mes, "tuten komand bohuzel v sz nefunkuje");
|
||||
|
||||
if (komand) return void runKomand(mes, komand, cmdName, celArgs);
|
||||
|
||||
@ -317,7 +349,7 @@ client.on("messageCreate", async mes => {
|
||||
const distance = levenshtein(cmd, cmdName);
|
||||
if (distance <= Math.ceil(cmdName.length * 0.3)) slova.push(cmd);
|
||||
});
|
||||
if (!slova.length) return void send(mes, "co to znamena ti gadzovko");
|
||||
if (!slova.length) return void messageReply(mes, "co to znamena ti gadzovko");
|
||||
|
||||
const nabidka = slova.sort().slice(0, 5);
|
||||
|
||||
@ -333,9 +365,9 @@ client.on("messageCreate", async mes => {
|
||||
radek.components.forEach((btn, i) => btn.setDisabled() && (i == lookupId && btn.setStyle(ButtonStyle.Success)));
|
||||
i.update({ content: `ok vole ${emouty.d3k}`, components: [radek] });
|
||||
|
||||
if (!cmd) return void send(mes, "bohuzel negdo sy ze mi dela prel");
|
||||
if (!cmd) return void messageReply(mes, "bohuzel negdo sy ze mi dela prel");
|
||||
|
||||
if (mes.channel.type == ChannelType.DM && cmd?.DMUnsafe) return void send(mes, "tuten komand bohuzel v sz nefunkuje");
|
||||
if (mes.channel.type == ChannelType.DM && cmd?.DMUnsafe) return void messageReply(mes, "tuten komand bohuzel v sz nefunkuje");
|
||||
|
||||
runKomand(mes, cmd, cmdName, celArgs);
|
||||
},
|
||||
@ -343,17 +375,28 @@ client.on("messageCreate", async mes => {
|
||||
});
|
||||
});
|
||||
|
||||
function alertPokudNestandardni(client: CClient, aft: Presence) {
|
||||
const presence = aft.clientStatus;
|
||||
|
||||
for (const pres in presence) {
|
||||
if (["web", "mobile", "desktop"].includes(pres)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Máme jinej
|
||||
adminLog(client, `zahlidnul jsem zvlastni status "${pres}".\n\`\`\`${JSON.stringify(presence)}\`\`\`\nod uzivatele ${aft.userId} ${aft.user}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Simulation of userPresenceUpdate event
|
||||
client.on("presenceUpdate", async (bef, aft) => {
|
||||
const user = aft.user as CUser | null;
|
||||
if (!user) return;
|
||||
if (!user.presence) user.presence = {};
|
||||
|
||||
logOOoZS(user.id, aft.clientStatus);
|
||||
|
||||
if (areStatusesSame(aft.clientStatus, user.presence)) return;
|
||||
|
||||
logSZS(user.id, aft.clientStatus);
|
||||
alertPokudNestandardni(client, aft);
|
||||
|
||||
const naCo = aft.clientStatus || {};
|
||||
user.presence = naCo;
|
||||
@ -361,7 +404,6 @@ client.on("presenceUpdate", async (bef, aft) => {
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
|
||||
if (!areStatusesSame(naCo, user.presence)) {
|
||||
logPZS(user.id, naCo, user.presence);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -369,7 +411,7 @@ client.on("presenceUpdate", async (bef, aft) => {
|
||||
});
|
||||
|
||||
client.on("interactionCreate", async int => {
|
||||
if (process.env.ignoreMess || !int.isCommand()) return;
|
||||
if (process.env.ignoreMess || !int.isChatInputCommand()) return;
|
||||
|
||||
const cmdName = int.commandName.slice(prefix.length);
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// Modul na komand "anketa"
|
||||
|
||||
import { ActionRowBuilder, APIEmbed, APIEmbedField, ButtonBuilder, ButtonStyle, CommandInteraction, ComponentType, Message, MessageComponentInteraction } from "discord.js";
|
||||
import { ActionRowBuilder, APIEmbed, APIEmbedField, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, ComponentType, Message, MessageComponentInteraction } from "discord.js";
|
||||
import { Modul, SRecord } from "../utils/types";
|
||||
import { formatter } from "../utils/utils";
|
||||
|
||||
function lookup<T>(opt: CommandInteraction["options"], item: string) {
|
||||
function lookup<T>(opt: ChatInputCommandInteraction["options"], item: string) {
|
||||
return opt.get(item)?.value as T | undefined;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { CClient, HelpServer, Komand, KomandNaExport, Modul, SMessage, SRecord } from "../utils/types";
|
||||
import { join } from "path";
|
||||
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||
import { oddiakritikovat, send, strankovani } from "../utils/utils";
|
||||
import { APIEmbed, Message } from "discord.js";
|
||||
import { oddiakritikovat, messageReply, strankovani } from "../utils/utils";
|
||||
import { APIEmbed } from "discord.js";
|
||||
|
||||
let client: CClient;
|
||||
const cesta = `${join(__dirname, "../../res/")}custom`;
|
||||
@ -63,13 +63,13 @@ function zmrdovoAliasy(zacatek: string, owner: string, mes: SMessage) {
|
||||
let text = "";
|
||||
arr.forEach(element => {
|
||||
if (text.length + element.length > 2000) {
|
||||
send(mes, { content: text, allowedMentions: { users: [] } });
|
||||
messageReply(mes, { content: text, allowedMentions: { users: [] } });
|
||||
text = "";
|
||||
}
|
||||
text += `${element}\n`;
|
||||
});
|
||||
|
||||
send(mes, { content: text, allowedMentions: { users: [] } });
|
||||
messageReply(mes, { content: text, allowedMentions: { users: [] } });
|
||||
}
|
||||
|
||||
const exp: Modul = {
|
||||
@ -310,7 +310,7 @@ const exp: Modul = {
|
||||
}
|
||||
},
|
||||
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
client = module.exports.client;
|
||||
zakladniKomandy = client.komandy;
|
||||
zakladniAliasy = client.aliasy;
|
||||
|
||||
@ -5,7 +5,7 @@ import { join } from "path";
|
||||
import { Priority, novejPlay } from "../utils/voice";
|
||||
import { lidiCoMajDenimPremium } from "../utils/denim-Spravce";
|
||||
import { exec } from "child_process";
|
||||
import { log, send } from "../utils/utils";
|
||||
import { betterFetch, log, messageReply } from "../utils/utils";
|
||||
|
||||
const kmenovaCesta = join(__dirname, `../../zvuky/priVstupu`);
|
||||
const formaty = ["mp3", "wav", "ogg"];
|
||||
@ -34,7 +34,7 @@ const exp: Modul = {
|
||||
const typ = soubor.name.slice(-3);
|
||||
const docasnaCesta = `${kmenovaCesta}/temp${Math.round(Math.random() * 1000)}.${typ}`;
|
||||
|
||||
const odpoved = await fetch(soubor.url).then(r => r.arrayBuffer());
|
||||
const odpoved = await betterFetch(soubor.url).then(r => r.arrayBuffer());
|
||||
writeFileSync(docasnaCesta, new DataView(odpoved));
|
||||
|
||||
// Zjistit running-time
|
||||
@ -42,14 +42,14 @@ const exp: Modul = {
|
||||
if (error) {
|
||||
log("chyba pri ffprobe", error);
|
||||
|
||||
send(mes, "bohuzel chiba");
|
||||
messageReply(mes, "bohuzel chiba");
|
||||
vymaz(docasnaCesta);
|
||||
return;
|
||||
}
|
||||
|
||||
// Maximum
|
||||
if (Number(stdout) > 13) {
|
||||
send(mes, "13 se kund maks");
|
||||
messageReply(mes, "13 se kund maks");
|
||||
vymaz(docasnaCesta);
|
||||
return;
|
||||
}
|
||||
@ -62,7 +62,7 @@ const exp: Modul = {
|
||||
|
||||
renameSync(docasnaCesta, `${zaklad}.${typ}`);
|
||||
|
||||
send(mes, "ej tot am");
|
||||
messageReply(mes, "ej tot am");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ChannelType, Message, MessageReaction } from "discord.js";
|
||||
import { emouty } from "../utils/emotes";
|
||||
import { Modul, SRecord } from "../utils/types";
|
||||
import { formatter, ping, send, sendDM } from "../utils/utils";
|
||||
import { formatter, ping, messageReply, sendDM, sendWithoutReply } from "../utils/utils";
|
||||
|
||||
const exp: Modul = {
|
||||
more_komandy: {
|
||||
@ -67,7 +67,7 @@ const exp: Modul = {
|
||||
argument.splice(0, 1);
|
||||
if (argument.length) setTimeout(() => randomshit(mes, argument), 1000);
|
||||
};
|
||||
send(mes, ":stop_button:").then(mes => randomshit(mes, [":five:", ":four:", ":three:", ":two:", ":one:", ":ok:"]));
|
||||
messageReply(mes, ":stop_button:").then(mes => randomshit(mes, [":five:", ":four:", ":three:", ":two:", ":one:", ":ok:"]));
|
||||
},
|
||||
|
||||
pocasi: () => {
|
||||
@ -92,7 +92,7 @@ const exp: Modul = {
|
||||
}
|
||||
|
||||
try {
|
||||
await mes.author.send(`test ${emouty.d3k}`);
|
||||
await sendWithoutReply(await mes.author.createDM(), `test ${emouty.d3k}`);
|
||||
} catch {
|
||||
return "ja ti ale napsat nemuzu ti kundo";
|
||||
}
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
import { TextChannel } from "discord.js";
|
||||
import { CClient, Modul } from "../utils/types";
|
||||
import { log } from "../utils/utils";
|
||||
import { betterFetch, log, sendWithoutReply } from "../utils/utils";
|
||||
|
||||
let client: CClient;
|
||||
|
||||
let najdiClanek = /href="(?<odkaz>.+?)">\n *<h2>(?<nazev>.+?)<\/h2>/;
|
||||
const najdiClanek = /href="(?<odkaz>.+?)">\n *<h2>(?<nazev>.+?)<\/h2>/;
|
||||
|
||||
let posledniNazev: string;
|
||||
let posledniOdkaz: string;
|
||||
|
||||
async function zkontrolovatNovinky() {
|
||||
const stranka = await fetch("https://histmy.eu/BUM/clanky")
|
||||
const stranka = await betterFetch("https://histmy.eu/BUM/clanky")
|
||||
.then(r => r.text())
|
||||
.catch(e => log("chyba pri accessovani BUM stránky", e));
|
||||
|
||||
let nazevAOdkaz = najdiClanek.exec(stranka || "");
|
||||
const nazevAOdkaz = najdiClanek.exec(stranka || "");
|
||||
|
||||
if (!nazevAOdkaz || !nazevAOdkaz.groups) return false;
|
||||
|
||||
const nazevClanku = nazevAOdkaz.groups.nazev;
|
||||
const odkazClanku = "https://histmy.eu/BUM/" + nazevAOdkaz.groups.odkaz;
|
||||
|
||||
|
||||
if (!nazevClanku) {
|
||||
log(new Error("neni nazev clanku"));
|
||||
return false;
|
||||
@ -58,18 +58,18 @@ async function urobit() {
|
||||
naplanovat();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const zprava = `Vyšel nový článek v kvalitním magazínu BUM: **${posledniNazev}**\nPřečtěte si ho zde: ${posledniOdkaz}`;
|
||||
|
||||
const general = guilda.channels.cache.get("555779161067749448") as TextChannel;
|
||||
if (!general) return log(new Error("general nenalezen"));
|
||||
general.send(`<@&1313491870231564318>\n${zprava}`);
|
||||
sendWithoutReply(general, `<@&1313491870231564318>\n${zprava}`);
|
||||
|
||||
naplanovat();
|
||||
}
|
||||
|
||||
const exp: Modul = {
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
client = module.exports.client;
|
||||
|
||||
urobit();
|
||||
|
||||
@ -2,10 +2,11 @@
|
||||
|
||||
import { AudioPlayerStatus, VoiceConnectionStatus } from "@discordjs/voice";
|
||||
import { Client } from "discord.js";
|
||||
import { search, stream, validate, video_basic_info } from "play-dl";
|
||||
import { search, validate, video_basic_info } from "play-dl";
|
||||
import ytdlko from "@distube/ytdl-core";
|
||||
import { emouty } from "../utils/emotes";
|
||||
import { Modul } from "../utils/types";
|
||||
import { adminLog, log, send } from "../utils/utils";
|
||||
import { adminLog, betterFetch, log, messageReply } from "../utils/utils";
|
||||
import { getConn, Hratelny, novejJoin, novejPlay, Priority, stopPlayer } from "../utils/voice";
|
||||
import { array, record, safeParse, string } from "valibot";
|
||||
|
||||
@ -19,6 +20,25 @@ const guildy = new Map<string, { kju: QueueItem[]; loop: boolean; }>();
|
||||
|
||||
const searchScema = array(record(string(), string()));
|
||||
|
||||
async function createHratelny(url: string): Promise<Hratelny> {
|
||||
/* Verze pro knihovnu play-dl */
|
||||
/* const src = await stream(url);
|
||||
|
||||
return {
|
||||
src: src.stream,
|
||||
volume: 1,
|
||||
type: src.type
|
||||
};*/
|
||||
|
||||
/* Verze pro ytdl-core */
|
||||
const src = ytdlko(url, { filter: "audioonly", highWaterMark: 1 << 25 });
|
||||
|
||||
return {
|
||||
src: src,
|
||||
volume: 1
|
||||
};
|
||||
}
|
||||
|
||||
async function playNext(guildId: string) {
|
||||
try {
|
||||
const guilda = guildy.get(guildId)!;
|
||||
@ -27,8 +47,7 @@ async function playNext(guildId: string) {
|
||||
|
||||
let coZahrat: Hratelny;
|
||||
if (!item.special) {
|
||||
const src = await stream(item.url);
|
||||
coZahrat = { src: src.stream, volume: 1, type: src.type };
|
||||
coZahrat = await createHratelny(item.url);
|
||||
} else {
|
||||
coZahrat = item.url;
|
||||
}
|
||||
@ -43,7 +62,7 @@ async function playNext(guildId: string) {
|
||||
return playNext(guildId);
|
||||
})
|
||||
.catch(e => {
|
||||
log("chyba v muziki", e);
|
||||
log("chyba v hrani muziki", e);
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof Error && e.message.startsWith("Seeking beyond limit"))
|
||||
@ -72,16 +91,16 @@ const exp: Modul = {
|
||||
ajtem.name = soubor.name;
|
||||
ajtem.url = soubor.url;
|
||||
ajtem.special = true;
|
||||
send(mes, `zahraju \`${soubor.name}\``);
|
||||
messageReply(mes, `zahraju \`${soubor.name}\``);
|
||||
} else if (txt == "") return "co mam zahrat??";
|
||||
else if (!druh) {
|
||||
ajtem.name = `nejaka picovina ot ${mes.author}`;
|
||||
ajtem.url = txt;
|
||||
ajtem.special = true;
|
||||
send(mes, `zkusim to zahrat`);
|
||||
messageReply(mes, `zkusim to zahrat`);
|
||||
}
|
||||
else if (druh == "search") {
|
||||
const msg = send(mes, "hledam");
|
||||
const msg = messageReply(mes, "hledam");
|
||||
const hledani = await search(txt, { limit: 1 });
|
||||
if (!hledani[0]) return "nic sem nenašel";
|
||||
ajtem.url = hledani[0].url;
|
||||
@ -93,13 +112,23 @@ const exp: Modul = {
|
||||
const video = await video_basic_info(txt);
|
||||
ajtem.name = video.video_details.title!;
|
||||
} catch (e) {
|
||||
return "sorka bracho ael tuto je ajdzreztrigtnuti";
|
||||
if (!(e instanceof Error)) {
|
||||
log("chyba ale nechyba v mzike", e);
|
||||
return "neco se fatk posralo";
|
||||
}
|
||||
|
||||
if (e.message.includes("age"))
|
||||
return "sorka bracho ael tuto je nesjpis ajdzreztrigtnuti";
|
||||
|
||||
log("chyba v hledani muziki", e);
|
||||
|
||||
return "doslo k random chybe";
|
||||
}
|
||||
if (typeof ajtem.name == "undefined") {
|
||||
const client: Client = module.exports.client;
|
||||
adminLog(client, "video nemá název");
|
||||
}
|
||||
send(mes, `zahraju \`${ajtem.name}\``);
|
||||
messageReply(mes, `zahraju \`${ajtem.name}\``);
|
||||
} else return "tuto neumim zahrat";
|
||||
|
||||
if (!guildy.has(guildId)) {
|
||||
@ -184,8 +213,10 @@ const exp: Modul = {
|
||||
const kju = guildy.get(mes.guildId!)?.kju;
|
||||
if (!kju?.length) return "nehraje nic";
|
||||
|
||||
const query = kju[0].name.split("-")[1] ?? kju[0].name;
|
||||
const res = await fetch(`https://search.karaoketexty.cz/index.php?q=${query}`)
|
||||
const nameSplited = kju[0].name.split("-");
|
||||
|
||||
const query = nameSplited[1] ?? kju[0].name;
|
||||
const res = await betterFetch(`https://search.karaoketexty.cz/index.php?q=${query}`)
|
||||
.then(res => res.text())
|
||||
.catch(log);
|
||||
|
||||
@ -195,11 +226,19 @@ const exp: Modul = {
|
||||
|
||||
if (!vyhledavani.success) return "KaraokeTexty se na mi visarly";
|
||||
|
||||
const vysledek = vyhledavani.output[0];
|
||||
let vysledek;
|
||||
|
||||
const vyfiltrovano = vyhledavani.output.filter(result => nameSplited.length && result.label.includes(nameSplited[0]) && result.label.includes(nameSplited[1]));
|
||||
|
||||
if (vyfiltrovano.length) {
|
||||
vysledek = vyfiltrovano[0];
|
||||
} else {
|
||||
vysledek = vyhledavani.output[0];
|
||||
}
|
||||
|
||||
if (!vysledek) return "KaraokeTexty nic nenasli";
|
||||
|
||||
const res2 = await fetch(`https://www.karaoketexty.cz/texty-pisni/h/h-${vysledek.id}`)
|
||||
const res2 = await betterFetch(`https://www.karaoketexty.cz/texty-pisni/h/h-${vysledek.id}`)
|
||||
.then(res => res.text())
|
||||
.catch(log);
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ const komandy: RESTPostAPIChatInputApplicationCommandsJSONBody[] = [
|
||||
];
|
||||
|
||||
const exp: Modul = {
|
||||
on_ready: async () => {
|
||||
on_clientReady: async () => {
|
||||
const client = module.exports.client as CClient;
|
||||
client.slashCommandy = {};
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import { APIEmbed, Message } from "discord.js";
|
||||
import { Modul } from "../utils/types";
|
||||
import { fokinLookupTable, klikance, pocetKeStrane } from "../utils/sachyEtc";
|
||||
import { emiter, sachyDomena } from "../utils/sachyServer";
|
||||
import { send } from "../utils/utils";
|
||||
import { messageReply } from "../utils/utils";
|
||||
|
||||
const hry = new Map<number, Hra>(); // gameID -> Hra
|
||||
const hraci = new Map<string, number>(); // hrac -> gameID
|
||||
@ -98,7 +98,7 @@ function jeCheck(barva: Hra["hraje"], deska: Deska) {
|
||||
// od pawnů
|
||||
[7, 9].forEach(i => {
|
||||
const pis = deska[index - i];
|
||||
if (pis?.typ == "pawn" && pis.barva != barva) check = true;
|
||||
if (pis?.typ == "pawn" && pocetKeStrane[index][i == 7 ? 1 : 3] > 0 && pis.barva != barva) check = true;
|
||||
});
|
||||
|
||||
// od králika
|
||||
@ -173,6 +173,13 @@ function tahyProPawny(index: number, deska: Deska) {
|
||||
if (index % 8 != 7 && deska[index - 7] && deska[index - 7]!.barva != barva)
|
||||
tahy.push(index - 7);
|
||||
|
||||
// en croassant
|
||||
if (pocetKeStrane[index][3] > 0 && deska[index - 1]?.enPassantovatelna)
|
||||
tahy.push(index - 9);
|
||||
|
||||
if (pocetKeStrane[index][1] > 0 && deska[index + 1]?.enPassantovatelna)
|
||||
tahy.push(index - 7);
|
||||
|
||||
// Blokáda
|
||||
if (deska[index - 8])
|
||||
return tahy;
|
||||
@ -183,13 +190,6 @@ function tahyProPawny(index: number, deska: Deska) {
|
||||
if (deska[index]?.netahnuta && !deska[index - 16])
|
||||
tahy.push(index - 16);
|
||||
|
||||
// en croassant
|
||||
if (deska[index - 1]?.enPassantovatelna)
|
||||
tahy.push(index - 9);
|
||||
|
||||
if (deska[index + 1]?.enPassantovatelna)
|
||||
tahy.push(index - 7);
|
||||
|
||||
return tahy;
|
||||
}
|
||||
|
||||
@ -218,6 +218,8 @@ function tahyProKrale(index: number, deska: Deska) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Math.abs(i) == 3) continue;
|
||||
|
||||
const novaDeska = [...deska];
|
||||
novaDeska[index + i] = deska[index];
|
||||
novaDeska[index] = undefined;
|
||||
@ -302,6 +304,45 @@ function renderHra(hra: Hra, konec?: true) {
|
||||
const deska = [...hra.deska];
|
||||
const vybranejPis = hra.vybranejPis;
|
||||
|
||||
const policka: Policko[] = [];
|
||||
|
||||
hra.tahy = [];
|
||||
|
||||
if (typeof vybranejPis == "number") hra.tahy = legalniTahy(vybranejPis, deska);
|
||||
|
||||
for (let i = 0; i < 64; i++) {
|
||||
|
||||
const figurka = deska[i];
|
||||
const jeTah = hra.tahy.includes(i);
|
||||
|
||||
const cernyPozadi = (Math.floor(i / 8) + (i % 8)) % 2;
|
||||
|
||||
if (!figurka) {
|
||||
|
||||
policka.push(jeTah
|
||||
? { typ: "tahnutelne", emoutId: cernyPozadi ? "1066376051422404628" : "1066376343807336488" }
|
||||
: { typ: "prazdne", barva: cernyPozadi ? "cerna" : "bila" }
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
let klic = (cernyPozadi ? "g" : "w") + (figurka.barva == "bila" ? "w" : "b") + figurka.typ;
|
||||
if (jeTah) klic += "t";
|
||||
else if (figurka.typ == "king" && figurka.barva == hra.hraje && jeCheck(figurka.barva, deska)) klic += "c";
|
||||
const emoutId = fokinLookupTable[klic];
|
||||
|
||||
const tahnutelny = !konec && figurka.barva == hra.hraje || jeTah;
|
||||
policka.push({ emoutId, typ: tahnutelny ? "tahnutelne" : "figurka" });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return policka;
|
||||
}
|
||||
|
||||
function generateGameEmbed(hra: Hra, konec?: true) {
|
||||
|
||||
const embed: APIEmbed = {
|
||||
fields: [
|
||||
{
|
||||
@ -317,51 +358,64 @@ function renderHra(hra: Hra, konec?: true) {
|
||||
]
|
||||
};
|
||||
|
||||
hra.tahy = [];
|
||||
|
||||
if (typeof vybranejPis == "number") hra.tahy = legalniTahy(vybranejPis, deska);
|
||||
const policka = renderHra(hra, konec);
|
||||
|
||||
for (let i = 0; i < 64; i++) {
|
||||
const figurka = deska[i];
|
||||
const klikanec = klikance[i];
|
||||
|
||||
const prvniDuhy = (i % 8) < 4 ? 0 : 1;
|
||||
const field = embed.fields![prvniDuhy];
|
||||
|
||||
const cernyPozadi = (Math.floor(i / 8) + (i % 8)) % 2;
|
||||
|
||||
if (!figurka) {
|
||||
|
||||
field.value += hra.tahy.includes(i)
|
||||
? (cernyPozadi ? `[<:h:1066376051422404628>](http://${sachyDomena}/${klikanec})` : `[<:h:1066376343807336488>](http://${sachyDomena}/${klikanec})`)
|
||||
: (cernyPozadi ? "🟩" : "⬜");
|
||||
|
||||
} else {
|
||||
|
||||
let klic = (cernyPozadi ? "g" : "w") + (figurka.barva == "bila" ? "w" : "b") + figurka.typ;
|
||||
if (hra.tahy.includes(i)) klic += "t";
|
||||
if (figurka.typ == "king" && figurka.barva == hra.hraje && jeCheck(figurka.barva, deska)) klic += "c";
|
||||
const emout = fokinLookupTable[klic];
|
||||
const figurkaStr = `<:h:${emout}>`;
|
||||
|
||||
if (!konec && figurka.barva == hra.hraje || hra.tahy.includes(i)) {
|
||||
field.value += `[${figurkaStr}](http://${sachyDomena}/${klikanec})`;
|
||||
} else {
|
||||
field.value += figurkaStr;
|
||||
}
|
||||
const policko = policka[i];
|
||||
const field = embed.fields![(i % 8) < 4 ? 0 : 1];
|
||||
|
||||
if (policko.typ == "prazdne")
|
||||
field.value += policko.barva == "bila" ? "⬜" : "🟩";
|
||||
else {
|
||||
const emout = `<:h:${policko.emoutId}>`;
|
||||
field.value += policko.typ == "figurka" ? emout : `[${emout}](http://${sachyDomena}/${klikance[i]})`;
|
||||
}
|
||||
|
||||
if (i % 8 == 3 || i % 8 == 7) field.value += "\n";
|
||||
if ((i % 8 == 3 || i % 8 == 7)) field.value += "\n";
|
||||
}
|
||||
|
||||
if (embed.fields![0].value.length > 1024 || embed.fields![1].value.length > 1024) {
|
||||
embed.fields = [
|
||||
{
|
||||
name: "a je to pici!",
|
||||
value: `Tuta pozice by vobsahovala moc vodkazu a diky pice diskordu se teda neda vykreslit. Tuten tah budes muset bohuzel vodehrat [na webu](http://${sachyDomena}/play).`
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
return embed;
|
||||
|
||||
}
|
||||
|
||||
emiter.on("render", (hrac, respond) => {
|
||||
const gameID = hraci.get(hrac)!;
|
||||
if (!gameID) return respond("Však vůbec nehraješ ty magore", true);
|
||||
const hra = hry.get(gameID)!;
|
||||
const hraje = hra.hraje == (hra.bila == hrac ? "bila" : "cerna");
|
||||
|
||||
const policka = renderHra(hra);
|
||||
let html = "<tr>";
|
||||
|
||||
|
||||
for (let i = 0; i < 64; i++) {
|
||||
const policko = policka[i];
|
||||
|
||||
if (policko.typ == "prazdne")
|
||||
html += policko.barva == "bila" ? `<td><img class="nic" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/2b1c.svg"></td>` : `<td><img class="nic" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f7e9.svg"></td>`;
|
||||
else {
|
||||
const obrazek = `<img src="https://cdn.discordapp.com/emojis/${policko.emoutId}.webp">`;
|
||||
html += (policko.typ == "figurka" || !hraje) ? `<td>${obrazek}</td>` : `<td><a href="http://${sachyDomena}/play/${klikance[i]}">${obrazek}</a></td>`;
|
||||
}
|
||||
|
||||
if (i % 8 == 7) html += "</tr>";
|
||||
}
|
||||
|
||||
respond(html);
|
||||
|
||||
});
|
||||
|
||||
function konec(mes: Message, hra: Hra, duvod: string) {
|
||||
mes.edit({ content: `hra zkoncila ${duvod}`, embeds: [renderHra(hra, true)] });
|
||||
mes.edit({ content: `hra zkoncila ${duvod}`, embeds: [generateGameEmbed(hra, true)] });
|
||||
|
||||
const gameID = hra.id;
|
||||
|
||||
@ -399,7 +453,7 @@ function prekreslitHru(hra: Hra) {
|
||||
if (pat)
|
||||
return konec(mes, hra, `achylova sytuace`);
|
||||
|
||||
mes.edit({ content: "", embeds: [renderHra(hra)] });
|
||||
mes.edit({ content: "", embeds: [generateGameEmbed(hra)] });
|
||||
}
|
||||
|
||||
emiter.on("tah", (hrac, policko, respond, promo) => {
|
||||
@ -412,7 +466,7 @@ emiter.on("tah", (hrac, policko, respond, promo) => {
|
||||
|
||||
const index = klikance.findIndex(e => e == policko);
|
||||
|
||||
if (typeof index != "number") return respond("Co to meleš za hovna?");
|
||||
if (index == -1) return respond("Co to meleš za hovna?");
|
||||
|
||||
// Kliknul na stejnej pis
|
||||
if (hra.vybranejPis == index) {
|
||||
@ -479,13 +533,13 @@ const exp: Modul = {
|
||||
if (hraci.has(player)) return "zakaz symultanki";
|
||||
}
|
||||
|
||||
const message = await send(mes, "hraj zopiciva");
|
||||
const message = await messageReply(mes, "hraj zopiciva");
|
||||
|
||||
const hra = createGame(++nextGameID, mes.author.id, druhej, message);
|
||||
hraci.set(mes.author.id, nextGameID);
|
||||
hraci.set(druhej, nextGameID);
|
||||
|
||||
message.edit({ content: "", embeds: [renderHra(hra)] });
|
||||
message.edit({ content: "", embeds: [generateGameEmbed(hra)] });
|
||||
|
||||
}
|
||||
},
|
||||
@ -510,7 +564,7 @@ type Hra = {
|
||||
bila: string;
|
||||
cerna: string;
|
||||
deska: Deska;
|
||||
hraje: "bila" | "cerna";
|
||||
hraje: Figurka["barva"];
|
||||
tahy: number[];
|
||||
vybranejPis?: number;
|
||||
message: Message;
|
||||
@ -524,3 +578,11 @@ type Figurka = {
|
||||
netahnuta: boolean;
|
||||
enPassantovatelna: boolean;
|
||||
};
|
||||
|
||||
type Policko = {
|
||||
typ: "prazdne";
|
||||
barva: Figurka["barva"];
|
||||
} | {
|
||||
typ: "figurka" | "tahnutelne";
|
||||
emoutId: string;
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ChannelType, Role, TextBasedChannel, User } from "discord.js";
|
||||
import { emouty } from "../utils/emotes";
|
||||
import { Modul, SRecord } from "../utils/types";
|
||||
import { formatCas, formatter, log, oddiakritikovat, ping, safeQuery, send, sendDM } from "../utils/utils";
|
||||
import { formatCas, formatter, log, oddiakritikovat, ping, safeQuery, messageReply, sendDM, sendWithoutReply } from "../utils/utils";
|
||||
|
||||
const enum Spinky {
|
||||
spinkacek,
|
||||
@ -283,7 +283,7 @@ const exp: Modul = {
|
||||
const entry = await getLastEntry(mes.author.id);
|
||||
if ((entry && !entry.vstavacek) && cmd != "vstavacek") {
|
||||
if (mes.channel.type == ChannelType.DM) {
|
||||
send(mes, "drz hubu");
|
||||
messageReply(mes, "drz hubu");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -314,7 +314,7 @@ const exp: Modul = {
|
||||
// autospink, ne autoautospink
|
||||
if (prop[0]) delete autoSpinky[aft.userId];
|
||||
const kanel = prop[1];
|
||||
if (kanel?.type == ChannelType.GuildText) kanel.send(await sendGmMessage(aft.member!.user));
|
||||
if (kanel?.type == ChannelType.GuildText) sendWithoutReply(kanel, await sendGmMessage(aft.member!.user));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Trekování statusů všech lidí o kterých bot ví
|
||||
import { Client, Guild, Presence } from "discord.js";
|
||||
import { FakePresence, Modul, SRecord, StatusyINaFounu, UserChange, ZmenovejObjekt } from "../utils/types";
|
||||
import { adminLog, log } from "../utils/utils";
|
||||
import { adminLog, betterFetch, log } from "../utils/utils";
|
||||
|
||||
const statusy = { Offline: "0", Online: "1", Idle: "2", DND: "3", OnlinePhone: "11", IdlePhone: "12", DNDPhone: "13" };
|
||||
const prepSend = (zmeny: UserChange[]) => {
|
||||
@ -25,7 +25,7 @@ const prepSend = (zmeny: UserChange[]) => {
|
||||
|
||||
const poslatData = (data: SRecord<unknown>) => {
|
||||
data.pwd = process.env.statPass;
|
||||
fetch("http://deadfish.cz:4629/endpoint-pro-denimka/", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) })
|
||||
betterFetch("http://deadfish.cz:4629/endpoint-pro-denimka/", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) })
|
||||
.catch(err => {
|
||||
log("err:", err);
|
||||
const client: Client<boolean> = module.exports.client;
|
||||
@ -85,7 +85,7 @@ const exp: Modul = {
|
||||
},
|
||||
|
||||
// Odeslání statusů při startu bota
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
if (process.env.ignorePresence) return;
|
||||
|
||||
const client: Client = module.exports.client;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// "Ulimatní" kapp
|
||||
|
||||
import { Modul } from "../utils/types";
|
||||
import { send, messageLinks, wait } from "../utils/utils";
|
||||
import { messageReply, messageLinks, wait } from "../utils/utils";
|
||||
|
||||
const maxRecurseLength = 10;
|
||||
|
||||
@ -40,7 +40,7 @@ const exp: Modul = {
|
||||
|
||||
if (getDepth(mes.id) == maxRecurseLength) {
|
||||
clear(mes.id);
|
||||
send(mes, "nemam rat sarandu");
|
||||
messageReply(mes, "nemam rat sarandu");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -1,41 +1,192 @@
|
||||
import { GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, TextChannel } from "discord.js";
|
||||
import { CClient, Modul } from "../utils/types";
|
||||
import { log } from "../utils/utils";
|
||||
import { betterFetch, log, sendWithoutReply } from "../utils/utils";
|
||||
import { RawData, WebSocket } from "ws";
|
||||
import { emouty } from "../utils/emotes";
|
||||
|
||||
let client: CClient;
|
||||
|
||||
async function ziskatNazev() {
|
||||
const stranka = await fetch("https://voyo.nova.cz/api/v1/show/content?showId=1&type=episodes&season=6596&count=1&offset=0&url=%2Fserialy%2F1-ordinace-v-ruzove-zahrade-2")
|
||||
.then(r => r.text())
|
||||
.catch(e => log("chyba pri accessovani VOYO stránky", e));
|
||||
const logg = (...cokoli: any[]) => log("[OnePlayDownloader]: ", ...cokoli);
|
||||
|
||||
const nazevFull = /h3 class=\"title\">.+?>(.+?)<\//s.exec(stranka || "");
|
||||
const token = process.env.OnePlayToken;
|
||||
|
||||
if (!nazevFull) {
|
||||
log(new Error("neni nazev"));
|
||||
return "Vordinačka";
|
||||
let clientId: string | undefined = undefined;
|
||||
let sessionId: string | undefined = undefined;
|
||||
let serverId: string | undefined = undefined;
|
||||
|
||||
let canForceNotify = true;
|
||||
|
||||
function createOneplayBody(payload: Record<string, any>, customData: string) {
|
||||
|
||||
if (typeof clientId == "undefined" || typeof sessionId == "undefined" || typeof serverId == "undefined") {
|
||||
throw new Error("není všechnno nastaveno");
|
||||
}
|
||||
|
||||
const nazevCasti = /(?<cislo>\d+). díl - (?<nazev>.+)/.exec(nazevFull[1]);
|
||||
const vec = {
|
||||
"deviceInfo": {
|
||||
"deviceType": "web",
|
||||
"appVersion": "1.0.18",
|
||||
"deviceManufacturer": "Unknown",
|
||||
"deviceOs": "Windows"
|
||||
},
|
||||
"capabilities": {
|
||||
"async": "websockets"
|
||||
},
|
||||
"payload": payload,
|
||||
"context": {
|
||||
"customData": customData,
|
||||
"requestId": crypto.randomUUID(),
|
||||
"clientId": clientId,
|
||||
"sessionId": sessionId,
|
||||
"serverId": serverId
|
||||
}
|
||||
};
|
||||
|
||||
return nazevCasti ? `${nazevCasti.groups!.cislo}. ${nazevCasti.groups!.nazev}` : nazevFull[1];
|
||||
return JSON.stringify(vec);
|
||||
}
|
||||
|
||||
async function udelejOneplayRquest(cesta: string, body: string) {
|
||||
if (!token) {
|
||||
throw new Error("token more");
|
||||
}
|
||||
|
||||
let ok = false;
|
||||
const res = await betterFetch(`https://http.cms.jyxo.cz/api/v3/${cesta}`, {
|
||||
method: "POST",
|
||||
body,
|
||||
headers: { Authorization: token }
|
||||
}).then(res => {
|
||||
ok = res.ok;
|
||||
res.json();
|
||||
})
|
||||
.catch(e => { throw new Error(`chyba pri udelejoneplayrequest fetch ${e}`); });
|
||||
|
||||
logg(`nejspis ${ok ? "" : "ne"}uspesna odpoved`, res);
|
||||
}
|
||||
|
||||
const sleep = (time: number) => new Promise(res => setTimeout(res, time));
|
||||
|
||||
async function executeOrdinaceFlow() {
|
||||
|
||||
// Inicializace
|
||||
await udelejOneplayRquest("app.init", createOneplayBody({
|
||||
"reason": "start",
|
||||
"route": {
|
||||
"url": "https://www.oneplay.cz/porad/1-ordinace-v-ruzove-zahrade-2"
|
||||
}
|
||||
}, `{"requireStartAction":true}`));
|
||||
|
||||
await sleep(500);
|
||||
|
||||
// Navigace na stránku Ordinace
|
||||
await udelejOneplayRquest("page.content.display", createOneplayBody({
|
||||
contentId: "show.1"
|
||||
}, `{"shouldBeInModal":true}`));
|
||||
|
||||
await sleep(500);
|
||||
|
||||
// Otevření 25. řady
|
||||
await udelejOneplayRquest("carousel.display", createOneplayBody({
|
||||
carouselId: "show:1;tab:65;parent:64;carousel:65",
|
||||
criteria: {
|
||||
filterCriterias: "season:15427",
|
||||
sortOption: "DESC"
|
||||
}
|
||||
}, `{"blockId":"show:1;tab:65;parent:64;block:65"}`));
|
||||
|
||||
}
|
||||
|
||||
const handleMessageAndGetNazev = (socket: WebSocket) => new Promise<string>((res, rej) => {
|
||||
const listener = (m: RawData) => {
|
||||
//const mes = m.toString();
|
||||
//logg("data:", mes);
|
||||
|
||||
const json = JSON.parse(m.toString());
|
||||
|
||||
logg("celyjson je", json);
|
||||
|
||||
// if (mes.includes("\"schema\":\"Ping\"")) {
|
||||
// logg("pingec, odpovidam");
|
||||
|
||||
// socket.send(`{"schema":"Pong"}`);
|
||||
// }
|
||||
|
||||
if (json.result?.schema == "ConnectionInitData") {
|
||||
logg("jojo,slysim a jdu na to");
|
||||
serverId = json.data.serverId;
|
||||
sessionId = json.data.sessionId;
|
||||
logg("serverid", serverId, "sessionid", sessionId);
|
||||
executeOrdinaceFlow().catch(rej);
|
||||
}
|
||||
else if (json?.schema == "ApiCall" && json?.command == "carousel.display") {
|
||||
logg("máme tady názvy epizod zvolené série");
|
||||
|
||||
const nazev = json?.response?.data?.carousel?.tiles?.[0]?.title;
|
||||
|
||||
//logg(typeof json, typeof json?.response, typeof json?.response?.data, typeof json?.response?.data?.carousel, typeof json?.response?.data?.carousel?.titles);
|
||||
|
||||
if (!nazev) {
|
||||
return rej("nazev neexistuje");
|
||||
}
|
||||
|
||||
if (typeof nazev != "string") {
|
||||
return rej("nazev neni string");
|
||||
}
|
||||
|
||||
clearTimeout(timeout);
|
||||
socket.off("message", listener);
|
||||
res(nazev);
|
||||
}
|
||||
};
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
socket.off("message", listener); // Odstraníme posluchač
|
||||
rej(new Error("Časový limit vypršel, jméno nebylo přijato."));
|
||||
}, 10000); // Timeout 10 sekund
|
||||
|
||||
|
||||
socket.on("message", listener);
|
||||
});
|
||||
|
||||
async function ziskatNazev() {
|
||||
// Tak tohle stojí fakt za hovno oproti voyu :sjeta:
|
||||
|
||||
clientId = crypto.randomUUID();
|
||||
|
||||
logg("moje Ws id je", clientId);
|
||||
|
||||
let socket: WebSocket | null = null;
|
||||
|
||||
try {
|
||||
socket = new WebSocket(`wss://ws.cms.jyxo.cz/websocket/${clientId}`);
|
||||
|
||||
return await handleMessageAndGetNazev(socket);
|
||||
} catch (e) {
|
||||
logg("nazev ordinace se nepodarilo ziskat", e);
|
||||
throw new Error("nazev neni");
|
||||
} finally {
|
||||
socket?.close();
|
||||
logg("zavrel jsem soket");
|
||||
}
|
||||
}
|
||||
|
||||
async function naplanovat() {
|
||||
const datum = new Date();
|
||||
const den = datum.getDay();
|
||||
|
||||
if (!(den == 1 && datum.getHours() < 12))
|
||||
if (!(den == 1 && datum.getHours() < 13))
|
||||
datum.setDate(datum.getDate() + ((den == 0 ? 1 : 8) - den));
|
||||
|
||||
datum.setHours(13);
|
||||
datum.setMinutes(0);
|
||||
datum.setSeconds(0);
|
||||
datum.setSeconds(1);
|
||||
|
||||
setTimeout(urobit, Number(datum) - Number(new Date()));
|
||||
}
|
||||
|
||||
async function urobit() {
|
||||
canForceNotify = true; // Hádám, kdyby se to nějak nepovedlo a bot nespadnul, aby se to dalo znovu spustit
|
||||
|
||||
const guilda = client.guilds.cache.get("555779161067749446");
|
||||
|
||||
if (!guilda) return log(new Error("dobytcarna nenalezena"));
|
||||
@ -44,8 +195,17 @@ async function urobit() {
|
||||
kdyToBude.setHours(20);
|
||||
kdyToBude.setSeconds(0);
|
||||
|
||||
let nazev = "";
|
||||
|
||||
try {
|
||||
nazev = await ziskatNazev();
|
||||
} catch (e) {
|
||||
logg("nepodarilo se ziskat nazev, pouzivam default");
|
||||
nazev = "Vordinačka";
|
||||
}
|
||||
|
||||
const event = await guilda.scheduledEvents.create({
|
||||
name: await ziskatNazev(),
|
||||
name: nazev,
|
||||
scheduledStartTime: kdyToBude,
|
||||
entityType: GuildScheduledEventEntityType.Voice,
|
||||
privacyLevel: GuildScheduledEventPrivacyLevel.GuildOnly,
|
||||
@ -56,20 +216,36 @@ async function urobit() {
|
||||
|
||||
if (!general) return log(new Error("general nenalezen"));
|
||||
|
||||
general.send(`<@&1123186280843444274> ${event.url}`);
|
||||
sendWithoutReply(general, `<@&1123186280843444274> ${event.url}`);
|
||||
|
||||
canForceNotify = false;
|
||||
|
||||
naplanovat();
|
||||
}
|
||||
|
||||
const exp: Modul = {
|
||||
more_komandy: {
|
||||
dalsiordinacka: () => `dalsi ordnacka <t:${Math.ceil((Date.now() - 414000000) / 604800000) * 604800 + 414000}:R>`
|
||||
dalsiordinacka: () => `dalsi ordnacka <t:${Math.ceil((Date.now() - 414000000) / 604800000) * 604800 + 414000}:R>`,
|
||||
|
||||
vynutitordinaceoznameni: {
|
||||
run: async mes => {
|
||||
if (!canForceNotify) {
|
||||
return "uz ne tyy mrtko";
|
||||
}
|
||||
|
||||
await urobit();
|
||||
mes.react(emouty.d3k);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
client = module.exports.client;
|
||||
|
||||
naplanovat();
|
||||
if (token) {
|
||||
naplanovat();
|
||||
//logg("nazev ordinace je:", await ziskatNazev());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { APIEmbed, CommandInteractionOption, Message, TextBasedChannel } from "discord.js";
|
||||
import { CClient, Modul } from "../utils/types";
|
||||
import { bazenek, log, strankovani } from "../utils/utils";
|
||||
import { bazenek, log, messageLinks, sendWithoutReply, strankovani } from "../utils/utils";
|
||||
|
||||
const zpracovatZpravu = (mes: Message) => new Promise<void>(async (res, rej) => {
|
||||
if ([6, 7, 8, 9, 10, 11, 18, 23, 46].includes(mes.type)) return res();
|
||||
@ -83,6 +83,7 @@ const exp: Modul = {
|
||||
}
|
||||
|
||||
const odpoved = await int.reply("hledam");
|
||||
messageLinks.set(odpoved.id, "<nic>"); // Hack, ale já na tohle už nechci šahat
|
||||
|
||||
const sql = `SELECT CONVERT(ID, CHAR) as idcko, SUBSTRING(Content, 1, 20) AS kontent FROM Zpravy WHERE ${parsedFiltry.join(" AND ")} ORDER BY ID ${seradit}`;
|
||||
bazenek.query({ sql, values: mista }, (err, res?: { idcko: string; kontent: string; }[]) => {
|
||||
@ -118,7 +119,7 @@ const exp: Modul = {
|
||||
fields: [{ name: zacatekNazvu, value: `• ${stranky[0].join("\n• ")}` }]
|
||||
};
|
||||
|
||||
if (stranky.length == 1) return int.channel?.send({ embeds: [embed] });
|
||||
if (stranky.length == 1) return sendWithoutReply(int.channel, { embeds: [embed] });
|
||||
|
||||
embed.fields![0].name += ` (1/${stranky.length})`;
|
||||
|
||||
@ -128,7 +129,7 @@ const exp: Modul = {
|
||||
}
|
||||
},
|
||||
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
const client = module.exports.client as CClient;
|
||||
|
||||
if (process.env.noGeneralSync) return;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { getVoiceConnections } from "@discordjs/voice";
|
||||
import { emouty } from "../utils/emotes";
|
||||
import { Modul } from "../utils/types";
|
||||
import { prefix, send } from "../utils/utils";
|
||||
import { prefix, messageReply } from "../utils/utils";
|
||||
import { novejLeave } from "../utils/voice";
|
||||
|
||||
let spim = false;
|
||||
@ -15,9 +15,9 @@ const exp: Modul = {
|
||||
if (spim) {
|
||||
spim = false;
|
||||
mes.client.user?.setStatus("online");
|
||||
send(mes, "dobré ráno magoří");
|
||||
messageReply(mes, "dobré ráno magoří");
|
||||
}
|
||||
else send(mes, "tak jsi kokot?");
|
||||
else messageReply(mes, "tak jsi kokot?");
|
||||
} else if (!spim) {
|
||||
if (cont == `${prefix} vypni se`) {
|
||||
mes.react(emouty.purfieRIP);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// Komandy nebo handelery který se nikam jinam nehodí
|
||||
|
||||
import { getVoiceConnections } from "@discordjs/voice";
|
||||
import { Client, TextChannel, } from "discord.js";
|
||||
import { Client } from "discord.js";
|
||||
import { createServer } from "http";
|
||||
import { Modul } from "../utils/types";
|
||||
import { adminLog, formatCas, log, nabidni, send, sendDM } from "../utils/utils";
|
||||
import { adminLog, formatCas, log, nabidni, messageReply, sendDM, sendWithoutReply, betterFetch } from "../utils/utils";
|
||||
import { emouty } from "../utils/emotes";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
@ -28,8 +28,18 @@ const exp: Modul = {
|
||||
run: async mes => {
|
||||
const sudo = mes.channel.id == process.env.adminChannel || mes.author.id == process.env.adminID;
|
||||
if (!sudo) {
|
||||
const verze = await fetch("https://denim3001.deadfish.cz/version.txt")
|
||||
.then(r => r.text());
|
||||
const verze = await betterFetch("https://gitea.deadfish.cz/Histmy/Denim-Bot/raw/branch/main/package.json")
|
||||
.then(r => r.json())
|
||||
.then(d => d.version)
|
||||
.catch(e => {
|
||||
log("nepodařilo se zjistit nejnovější verzi", e);
|
||||
return false;
|
||||
});
|
||||
|
||||
if (verze === false) {
|
||||
return "nevim estli se muzu neco naucit";
|
||||
}
|
||||
|
||||
if (verze == require("../../package.json").version) return `ale ja se nemam co priucit vole kkte ${mes.author}`;
|
||||
}
|
||||
|
||||
@ -123,7 +133,7 @@ const exp: Modul = {
|
||||
|
||||
(async () => {
|
||||
if (mes.author.id == client.user?.id)
|
||||
return mes.content != "uz nechci" ? send(mes, "uz nechci") : "";
|
||||
return mes.content != "uz nechci" ? messageReply(mes, "uz nechci") : "";
|
||||
const adminRole = mes.member?.roles.cache.find(r => r.name == "admin");
|
||||
if (adminRole) {
|
||||
await mes.member?.roles.remove(adminRole).catch(e => log(mes.author.displayName, "nejde odebrat admin", e));
|
||||
@ -133,14 +143,14 @@ const exp: Modul = {
|
||||
if (adminRole) setTimeout(() => {
|
||||
mes.member?.roles.add(adminRole);
|
||||
}, 60_000);
|
||||
send(mes, emouty.fu);
|
||||
messageReply(mes, emouty.fu);
|
||||
})();
|
||||
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
on_ready: () => {
|
||||
on_clientReady: () => {
|
||||
// Nastavení clienta
|
||||
client = module.exports.client;
|
||||
|
||||
@ -164,7 +174,7 @@ const exp: Modul = {
|
||||
if (!user) return res.end("takovyho kkta neznam");
|
||||
|
||||
user.createDM().then(async dm => {
|
||||
await dm.send(content);
|
||||
await sendWithoutReply(dm, content);
|
||||
res.statusCode = 200;
|
||||
res.end("OK");
|
||||
}).catch((e: Error) => {
|
||||
@ -197,8 +207,14 @@ const exp: Modul = {
|
||||
on_userPresenceUpdate: (bef, aft) => {
|
||||
if (aft.user?.id != "355053867265818635" || bef?.status == "online" || aft.status != "online") return;
|
||||
|
||||
(client.channels.cache.get("555779161067749448") as TextChannel)
|
||||
.send("https://tenor.com/view/pavel-is-online-gif-21604335");
|
||||
const channel = client.channels.cache.get("555779161067749448");
|
||||
|
||||
if (!channel || !channel.isSendable()) {
|
||||
log("nelze poslat zpravu o Pavelovi, kanal nenalezen");
|
||||
return;
|
||||
}
|
||||
|
||||
sendWithoutReply(channel, "https://tenor.com/view/pavel-is-online-gif-21604335");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { array, safeParse, string } from "valibot";
|
||||
import { adminLog, log } from "./utils";
|
||||
import { adminLog, betterFetch, log } from "./utils";
|
||||
import { Client } from "discord.js";
|
||||
|
||||
let client: Client;
|
||||
@ -20,9 +20,9 @@ function naplanovat() {
|
||||
}
|
||||
|
||||
async function sync() {
|
||||
const res = await fetch("https://util.deadfish.cz/denim+/subscriptions.json")
|
||||
const res = await betterFetch("https://util.deadfish.cz/denim+/subscriptions.json")
|
||||
.then(r => r.json())
|
||||
.catch(log);
|
||||
.catch(e => log("chyba pri ziskavani denim- predplatitelu", e));
|
||||
|
||||
const result = safeParse(subscriptionsSchema, res);
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import { SRecord } from "./types";
|
||||
import { join } from "path";
|
||||
import { readFileSync } from "fs";
|
||||
import { TypedEmitter } from "tiny-typed-emitter";
|
||||
import { log } from "./utils";
|
||||
import { betterFetch, log } from "./utils";
|
||||
|
||||
const basePath = join(__dirname, "../../res/sachy");
|
||||
const sessions: SRecord<Session> = {};
|
||||
@ -14,11 +14,13 @@ const indexStranka = readFileSync(`${basePath}/index.html`).toString();
|
||||
const tahStranka = readFileSync(`${basePath}/tah.html`).toString();
|
||||
const promoStranka = readFileSync(`${basePath}/promotion.html`).toString();
|
||||
const chybaStranka = readFileSync(`${basePath}/error.html`).toString();
|
||||
const hraStranka = readFileSync(`${basePath}/game.html`).toString();
|
||||
|
||||
export const sachyDomena = process.env.sachyDomena ?? "šach.ml";
|
||||
|
||||
interface Eventy {
|
||||
tah: (playerId: string, square: string, verify: (err?: string) => void, promotionType?: string) => void;
|
||||
render: (playerId: string, send: (html: string, err?: true) => void) => void;
|
||||
}
|
||||
|
||||
export const emiter = new TypedEmitter<Eventy>();
|
||||
@ -101,16 +103,16 @@ function loginErr(res: ServerResponse) {
|
||||
);
|
||||
}
|
||||
|
||||
async function overeni(url: string, session: Session, res: ServerResponse) {
|
||||
async function overeni(url: URL, session: Session, res: ServerResponse) {
|
||||
|
||||
const code = (new URL(url, "h:/")).searchParams.get("code");
|
||||
const data = await fetch("https://discord.com/api/v10/oauth2/token", { method: "post", body: `client_id=1064269692165963826&client_secret=8HHKODmb1HTLWoJGVyoinSU_9323dEla&grant_type=authorization_code&code=${code}&redirect_uri=http%3A%2F%2F${encodeURIComponent(sachyDomena)}%2Foauth`, headers: { "Content-type": "application/x-www-form-urlencoded" } })
|
||||
const code = url.searchParams.get("code");
|
||||
const data = await betterFetch("https://discord.com/api/v10/oauth2/token", { method: "post", body: `client_id=1064269692165963826&client_secret=8HHKODmb1HTLWoJGVyoinSU_9323dEla&grant_type=authorization_code&code=${code}&redirect_uri=http%3A%2F%2F${encodeURIComponent(sachyDomena)}%2Foauth`, headers: { "Content-type": "application/x-www-form-urlencoded" } })
|
||||
.then(r => r.json())
|
||||
.catch(err => log("sachy jednotka:", err));
|
||||
|
||||
if (!data?.access_token) return loginErr(res);
|
||||
|
||||
const uzivatel = await fetch("https://discord.com/api/v10/users/@me", { headers: { authorization: `Bearer ${data.access_token}` } })
|
||||
const uzivatel = await betterFetch("https://discord.com/api/v10/users/@me", { headers: { authorization: `Bearer ${data.access_token}` } })
|
||||
.then(r => r.json())
|
||||
.catch(err => log("sachy dva:", err));
|
||||
|
||||
@ -146,16 +148,48 @@ function validateMove(res: ServerResponse, session: Session, url: string) {
|
||||
emiter.emit("tah", session.discordId!, pismenko, overeni, promoNa);
|
||||
}
|
||||
|
||||
function renderHra(url: URL, session: Session, res: ServerResponse) {
|
||||
if (!session.logedIn) return redirect(res, `/login?redirect=/play${url.search}`);
|
||||
|
||||
let error: string | undefined = undefined;
|
||||
|
||||
function serveHTML(html: string, err?: true) {
|
||||
const vec = hraStranka
|
||||
.replace("$domena", sachyDomena);
|
||||
|
||||
let errForPrint = error ?? err;
|
||||
if (errForPrint) return res.end(vec.replace("$pecko", html).replace("$hra", ""));
|
||||
|
||||
res.end(vec.replace("$hra", html).replace("$pecko", ""));
|
||||
}
|
||||
|
||||
const tah = url.pathname.match(/\/play\/(.)$/);
|
||||
if (!tah) return emiter.emit("render", session.discordId!, serveHTML);
|
||||
const promoNa = url.search[1];
|
||||
|
||||
function handlePromote(err?: string) {
|
||||
if (err == "--promote--")
|
||||
return res.end(promoStranka.replace("$domena", sachyDomena));
|
||||
|
||||
error = err;
|
||||
emiter.emit("render", session.discordId!, serveHTML);
|
||||
}
|
||||
emiter.emit("tah", session.discordId!, tah[1], handlePromote, promoNa);
|
||||
|
||||
}
|
||||
|
||||
const server = createServer((req, res) => {
|
||||
|
||||
const session = startSession(req, res);
|
||||
const url = new URL(req.url!, `http://${sachyDomena}`);
|
||||
|
||||
// log(url.pathname, url.search, url.searchParams, req.url);
|
||||
|
||||
// Zpracování tahu
|
||||
if (url.pathname.length == 2 || url.pathname.length == 4) return validateMove(res, session, req.url!);
|
||||
|
||||
// Oauth
|
||||
if (req.url?.startsWith("/oauth")) return overeni(req.url, session, res);
|
||||
// Hra v prohlížeči
|
||||
if (url.pathname.startsWith("/play")) return renderHra(url, session, res);
|
||||
|
||||
// Jinak
|
||||
switch (url.pathname) {
|
||||
@ -172,6 +206,9 @@ const server = createServer((req, res) => {
|
||||
return login(session, res);
|
||||
}
|
||||
|
||||
case "/oauth":
|
||||
return overeni(url, session, res);
|
||||
|
||||
case "/logout":
|
||||
return logout(session, res);
|
||||
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
import { ClientPresenceStatusData } from "discord.js";
|
||||
import { appendFileSync } from "fs";
|
||||
import { SRecord } from "./types";
|
||||
|
||||
const cesta = "statlog.dlog";
|
||||
|
||||
appendFileSync(cesta, "\n\n\nDLOG3.0\n");
|
||||
|
||||
let aktualniOffset: number;
|
||||
const lidiVDLOG3 = new Map<string, string>();
|
||||
|
||||
function updateOffset() {
|
||||
aktualniOffset = Date.now();
|
||||
appendFileSync(cesta, `T${aktualniOffset.toString(36)}\n`);
|
||||
}
|
||||
setInterval(updateOffset, 27 * 60 * 1000);
|
||||
updateOffset();
|
||||
|
||||
export function getDLOGTimestamp() {
|
||||
return (Date.now() - aktualniOffset).toString(36);
|
||||
}
|
||||
|
||||
export function getIdInDLOG3(id: string) {
|
||||
if (lidiVDLOG3.has(id)) // Pokud už je v mapě
|
||||
return lidiVDLOG3.get(id);
|
||||
|
||||
// Pokud není v mapě vygenerujeme nové ID a uložíme do mapy
|
||||
let letters = '';
|
||||
let num = lidiVDLOG3.size + 1;
|
||||
while (num > 0) {
|
||||
num--; // Adjust for 0-indexing
|
||||
// Get the remainder and convert to a character
|
||||
letters = String.fromCharCode((num % 26) + 65) + letters;
|
||||
// Divide by 26 for the next iteration
|
||||
num = Math.floor(num / 26);
|
||||
}
|
||||
|
||||
lidiVDLOG3.set(id, letters);
|
||||
|
||||
return `${letters}${id}`;
|
||||
}
|
||||
|
||||
const platformTable: SRecord<string> = {
|
||||
desktop: "D",
|
||||
web: "W",
|
||||
mobile: "M"
|
||||
};
|
||||
|
||||
const statusTable: SRecord<number> = {
|
||||
online: 1,
|
||||
idle: 2,
|
||||
dnd: 3
|
||||
};
|
||||
|
||||
export function statusToDLOG3(status: ClientPresenceStatusData | null) {
|
||||
if (!status) return "-";
|
||||
|
||||
let tovje = [];
|
||||
|
||||
for (const [key, value] of Object.entries(status)) {
|
||||
const platform = platformTable[key] ?? key;
|
||||
const status = statusTable[value] ?? 0;
|
||||
if (status) tovje.push(`${platform} ${status}`);
|
||||
}
|
||||
|
||||
if (!tovje.length) return "-";
|
||||
|
||||
return tovje.join(" ");
|
||||
}
|
||||
|
||||
// Logování Obecného oznámení o změně statusu
|
||||
export function logOOoZS(userId: string, status: ClientPresenceStatusData | null) {
|
||||
const timestamp = getDLOGTimestamp();
|
||||
const id = getIdInDLOG3(userId);
|
||||
const stat = statusToDLOG3(status);
|
||||
appendFileSync(cesta, `${timestamp}${id}o${stat}\n`);
|
||||
}
|
||||
|
||||
// Logování Skutečné změny statusu
|
||||
export function logSZS(userId: string, status: ClientPresenceStatusData | null) {
|
||||
const id = getIdInDLOG3(userId);
|
||||
const stat = statusToDLOG3(status);
|
||||
appendFileSync(cesta, `${id}s${stat}\n`);
|
||||
}
|
||||
|
||||
// Logování Podezřelé změny statusu
|
||||
export function logPZS(userId: string, status1: ClientPresenceStatusData | null, status2: ClientPresenceStatusData | null) {
|
||||
const id = getIdInDLOG3(userId);
|
||||
const stat1 = statusToDLOG3(status1);
|
||||
const stat2 = statusToDLOG3(status2);
|
||||
appendFileSync(cesta, `${id}p${stat1}|${stat2}\n`);
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
import { VoiceConnection } from "@discordjs/voice";
|
||||
import { Awaitable, BaseMessageOptions, Client, ClientEvents, ClientPresenceStatusData, CommandInteraction, Message, MessageCreateOptions, OmitPartialGroupDMChannel, Presence, User } from "discord.js";
|
||||
import { Awaitable, BaseMessageOptions, ChatInputCommandInteraction, Client, ClientEvents, ClientPresenceStatusData, Message, MessageCreateOptions, OmitPartialGroupDMChannel, Presence, User } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
export type SMessage = OmitPartialGroupDMChannel<Message>;
|
||||
|
||||
export type RunFunkce = (message: SMessage, argumenty: string) => Awaitable<string | MessageCreateOptions | void>;
|
||||
export type InteractionRunFunkce = (interaction: CommandInteraction) => Awaitable<string | BaseMessageOptions | void>;
|
||||
export type InteractionRunFunkce = (interaction: ChatInputCommandInteraction) => Awaitable<string | BaseMessageOptions | void>;
|
||||
|
||||
export type BaseKomandProps = {
|
||||
als?: string[];
|
||||
|
||||
@ -9,7 +9,7 @@ if (!existsSync("config.json")) throw new Error("config.json neexistuje");
|
||||
const konfig = require("../../config.json");
|
||||
if (!konfig.ignoreUnknownKeys)
|
||||
for (const klic of Object.keys(konfig)) {
|
||||
if (!["adminChannel", "adminID", "DBPwd", "DBUser", "dieOnError", "ignoreMess", "ignorePresence", "ignoreSpink", "ignoreUnknownKeys", "noGeneralSync", "prefix", "sachyDomena", "statPass", "token"].includes(klic)) throw new Error(`config.json obsahuje neznámý klíč: ${klic}`);
|
||||
if (!["adminChannel", "adminID", "DBPwd", "DBUser", "dieOnError", "ignoreMess", "ignorePresence", "ignoreSpink", "ignoreUnknownKeys", "noGeneralSync", "OnePlayToken", "prefix", "sachyDomena", "statPass", "token"].includes(klic)) throw new Error(`config.json obsahuje neznámý klíč: ${klic}`);
|
||||
}
|
||||
process.env = { ...process.env, ...konfig };
|
||||
|
||||
@ -81,7 +81,7 @@ export function adminLog(client: Client, text: string, err?: string | Error) {
|
||||
if (process.env.adminChannel) {
|
||||
const adminChannel = client.channels.cache.get(process.env.adminChannel);
|
||||
if (adminChannel?.type == ChannelType.GuildText)
|
||||
adminChannel.send(err ? `${text}\n\`\`\`${err}\`\`\`` : text);
|
||||
sendWithoutReply(adminChannel, err ? `${text}\n\`\`\`${err}\`\`\`` : text);
|
||||
}
|
||||
if (process.env.adminID) {
|
||||
const user = client.users.cache.get(process.env.adminID);
|
||||
@ -90,17 +90,35 @@ export function adminLog(client: Client, text: string, err?: string | Error) {
|
||||
}
|
||||
|
||||
export function log(...content: unknown[]) {
|
||||
const jo = content.map(h => {
|
||||
if (h instanceof Error) return `\x1b[31m${h.stack || h}\x1b[0m`;
|
||||
return h;
|
||||
let hasError = false;
|
||||
|
||||
const colored = content.map(entry => {
|
||||
if (entry instanceof Error) {
|
||||
hasError = true;
|
||||
return `\x1b[31m${entry.stack || entry}\x1b[0m`;
|
||||
}
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
const d = new Date();
|
||||
console.log(`[${d.getDate()}.${d.getMonth() + 1}. ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}]:`, ...jo);
|
||||
|
||||
const params = [`[${d.getDate()}.${d.getMonth() + 1}. ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}]:`, ...colored];
|
||||
|
||||
if (hasError) {
|
||||
console.error(...params);
|
||||
} else {
|
||||
console.log(...params);
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendDM(user: User, txt: string) {
|
||||
user.send(txt).catch(() => log(new Error(`dementovi ${user} nejde poslat DM`)));
|
||||
try {
|
||||
const channel = await user.createDM();
|
||||
await sendWithoutReply(channel, txt);
|
||||
} catch (e) {
|
||||
log(new Error(`dementovi ${user} nejde poslat DM ${txt}`));
|
||||
}
|
||||
}
|
||||
|
||||
export const rand = (max: number) => Math.floor(Math.random() * max);
|
||||
@ -138,12 +156,12 @@ export async function nabidni(nastaveni: Nastaveni) {
|
||||
radek.addComponents(component);
|
||||
});
|
||||
|
||||
const zprava = await nastaveni.channel.send({ ...nastaveni.zpravec, components: [radek] });
|
||||
const zprava = await sendWithoutReply(nastaveni.channel, { ...nastaveni.zpravec, components: [radek] });
|
||||
const collector = nastaveni.channel.createMessageComponentCollector<ComponentType.Button>({ filter: i => i.message.id == zprava.id, time: nastaveni.timeout ?? 18e4 });
|
||||
|
||||
collector.on("collect", i => {
|
||||
const lookupId = Number(i.customId);
|
||||
if (isNaN(lookupId)) return void nastaveni.channel.send("neco nefunguje idk");
|
||||
if (isNaN(lookupId)) return void sendWithoutReply(nastaveni.channel, "neco nefunguje idk");
|
||||
|
||||
nastaveni.onCollect(i, lookupId, radek);
|
||||
});
|
||||
@ -208,21 +226,49 @@ export const messageLinks = new Map<string, string>();
|
||||
* @param mes Zpráva na kterou se má počkat
|
||||
*/
|
||||
export async function wait(mes: Message) {
|
||||
const waitingFrom = Date.now();
|
||||
|
||||
while (true) {
|
||||
if (messageLinks.has(mes.id))
|
||||
return;
|
||||
|
||||
if (Date.now() - waitingFrom > 30_000) {
|
||||
const err = new Error(`Zpráva ${mes.id} nebyla zařazena do messageLinks do 30 sekund`);
|
||||
adminLog(mes.client, "při čekání na zprávu jsem se nedočkal", err);
|
||||
log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
await new Promise(r => setTimeout(r, 0));
|
||||
}
|
||||
}
|
||||
|
||||
export async function send(mes: SMessage, co: string | MessageCreateOptions) {
|
||||
const nova = await mes.channel.send(co);
|
||||
async function baseSend(channel: SendableChannels, co: string | MessageCreateOptions, orgId: string) {
|
||||
const nova = await channel.send(co);
|
||||
|
||||
messageLinks.set(nova.id, mes.id);
|
||||
messageLinks.set(nova.id, orgId);
|
||||
|
||||
return nova;
|
||||
}
|
||||
|
||||
/**
|
||||
* Slouží k odeslání zprávy jako odpověď na jinou zprávu a zajistí, anti-spam mechanismus bude fungovat.
|
||||
* @param mes Zpráva na kterou se má odpovědět
|
||||
* @param co Obsah zprávy, který se má odeslat
|
||||
*/
|
||||
export async function messageReply(mes: SMessage, co: string | MessageCreateOptions) {
|
||||
return await baseSend(mes.channel, co, mes.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Slouží k odeslání zprávy bez odpovědi na jinou zprávu a zajistí, že anti-spam mechanismus bude fungovat.
|
||||
* @param channel Kanál, kam se má zpráva odeslat
|
||||
* @param co Obsah zprávy, který se má odeslat
|
||||
*/
|
||||
export async function sendWithoutReply(channel: SendableChannels, co: string | MessageCreateOptions) {
|
||||
return await baseSend(channel, co, "<nic>");
|
||||
}
|
||||
|
||||
export const areStatusesSame = (object1?: ClientPresenceStatusData | null, object2?: ClientPresenceStatusData | null) => {
|
||||
|
||||
if ((object1 === null || object1 === undefined) && (object2 === null || object2 === undefined)) return true;
|
||||
@ -243,3 +289,19 @@ export const areStatusesSame = (object1?: ClientPresenceStatusData | null, objec
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
export async function betterFetch(url: string, options?: RequestInit) {
|
||||
const maxRetry = 5;
|
||||
const retryWait = 3_000;
|
||||
|
||||
for (let currentAttempt = 1; currentAttempt < maxRetry; currentAttempt++) {
|
||||
try {
|
||||
return await fetch(url, options);
|
||||
} catch (err) {
|
||||
log(`Chyba při stahování ${url}, pokus číslo ${currentAttempt}, čekám ${retryWait / 1000} sekund`);
|
||||
await new Promise(r => setTimeout(r, retryWait));
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`Nepodařilo se stáhnout ${url} ani na ${maxRetry} pokusů`);
|
||||
}
|
||||
|
||||
@ -72,7 +72,6 @@ export const novejJoin = (guild: Guild, channelId: string) => new Promise<boolea
|
||||
const conn = joinVoiceChannel({
|
||||
channelId: channelId,
|
||||
guildId,
|
||||
//@ts-ignore PIČOVINA ZASRATA!"!"!"!"!"!"!""""
|
||||
adapterCreator: guild.voiceAdapterCreator
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user