Compare commits

..

8 commits

Author SHA1 Message Date
2b2bab9d51 Merge branch 'main' into feature/user-decriptions 2023-12-13 17:09:08 +01:00
722862ded3 Add shell.nix
to development util on nixos system
2023-12-13 17:06:09 +01:00
c911e567c6 Update dependencies 2023-12-13 17:04:18 +01:00
6e1cb8c956 Merge branch 'refactor/scripts' 2023-10-12 12:01:52 +02:00
a186ba9e80 scripts/pushCommands: Refactor how commands are being read
this should reduce errors when reading commands
also this won't fail if reading one command fails
2023-10-12 11:55:53 +02:00
a05047ab7d script/pushCommands: make sure the script exits 2023-09-30 14:47:10 +02:00
4729f7f563 /check-limit: rename to check-quota and change description
to match it to the new reality, limits are named quotas now

description of an option previously was longer than 100 characters
which discord api didn't like it
2023-09-30 14:46:12 +02:00
6a31473d22 scripts: move scripts to the project root directory
I believe, that these kind of scripts should reside there
instead of src directory
2023-09-30 14:46:12 +02:00
7 changed files with 179 additions and 137 deletions

View file

@ -12,6 +12,7 @@ RUN npx prisma generate
# Typescript compiling # Typescript compiling
COPY tsconfig.json . COPY tsconfig.json .
COPY src ./src COPY src ./src
COPY scripts ./scripts
RUN npx tsc RUN npx tsc
# Run the app # Run the app

266
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "0.1.0", "version": "0.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@prisma/client": "5.5.2", "@prisma/client": "5.7.0",
"discord.js": "^14.8.0", "discord.js": "^14.8.0",
"fold-to-ascii": "^5.0.1", "fold-to-ascii": "^5.0.1",
"gpt-3-encoder": "^1.1.4", "gpt-3-encoder": "^1.1.4",
@ -23,7 +23,7 @@
"@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0", "@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.46.0", "eslint": "^8.46.0",
"prisma": "5.5.2" "prisma": "5.7.0"
} }
}, },
"node_modules/@aashutoshrathi/word-wrap": { "node_modules/@aashutoshrathi/word-wrap": {
@ -72,9 +72,9 @@
} }
}, },
"node_modules/@discordjs/rest": { "node_modules/@discordjs/rest": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.1.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.2.0.tgz",
"integrity": "sha512-5gFWFkZX2JCFSRzs8ltx8bWmyVi0wPMk6pBa9KGIQSDPMmrP+uOrZ9j9HOwvmVWGe+LmZ5Bov0jMnQd6/jVReg==", "integrity": "sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==",
"dependencies": { "dependencies": {
"@discordjs/collection": "^2.0.0", "@discordjs/collection": "^2.0.0",
"@discordjs/util": "^1.0.2", "@discordjs/util": "^1.0.2",
@ -158,9 +158,9 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.1.3", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
"integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
@ -181,9 +181,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.53.0", "version": "8.55.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz",
"integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -266,13 +266,10 @@
} }
}, },
"node_modules/@prisma/client": { "node_modules/@prisma/client": {
"version": "5.5.2", "version": "5.7.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.5.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.7.0.tgz",
"integrity": "sha512-54XkqR8M+fxbzYqe+bIXimYnkkcGqgOh0dn0yWtIk6CQT4IUCAvNFNcQZwk2KqaLU+/1PHTSWrcHtx4XjluR5w==", "integrity": "sha512-cZmglCrfNbYpzUtz7HscVHl38e9CrUs31nrVoGUK1nIPXGgt8hT4jj2s657UXcNdQ/jBUxDgGmHyu2Nyrq1txg==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": {
"@prisma/engines-version": "5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a"
},
"engines": { "engines": {
"node": ">=16.13" "node": ">=16.13"
}, },
@ -285,31 +282,64 @@
} }
} }
}, },
"node_modules/@prisma/debug": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.7.0.tgz",
"integrity": "sha512-tZ+MOjWlVvz1kOEhNYMa4QUGURY+kgOUBqLHYIV8jmCsMuvA1tWcn7qtIMLzYWCbDcQT4ZS8xDgK0R2gl6/0wA==",
"devOptional": true
},
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "5.5.2", "version": "5.7.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.5.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.7.0.tgz",
"integrity": "sha512-Be5hoNF8k+lkB3uEMiCHbhbfF6aj1GnrTBnn5iYFT7GEr3TsOEp1soviEcBR0tYCgHbxjcIxJMhdbvxALJhAqg==", "integrity": "sha512-TkOMgMm60n5YgEKPn9erIvFX2/QuWnl3GBo6yTRyZKk5O5KQertXiNnrYgSLy0SpsKmhovEPQb+D4l0SzyE7XA==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true "hasInstallScript": true,
"dependencies": {
"@prisma/debug": "5.7.0",
"@prisma/engines-version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9",
"@prisma/fetch-engine": "5.7.0",
"@prisma/get-platform": "5.7.0"
}
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
"version": "5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a", "version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9.tgz",
"integrity": "sha512-O+qHFnZvAyOFk1tUco2/VdiqS0ym42a3+6CYLScllmnpbyiTplgyLt2rK/B9BTjYkSHjrgMhkG47S0oqzdIckA==" "integrity": "sha512-V6tgRVi62jRwTm0Hglky3Scwjr/AKFBFtS+MdbsBr7UOuiu1TKLPc6xfPiyEN1+bYqjEtjxwGsHgahcJsd1rNg==",
"devOptional": true
},
"node_modules/@prisma/fetch-engine": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.7.0.tgz",
"integrity": "sha512-zIn/qmO+N/3FYe7/L9o+yZseIU8ivh4NdPKSkQRIHfg2QVTVMnbhGoTcecbxfVubeTp+DjcbjS0H9fCuM4W04w==",
"devOptional": true,
"dependencies": {
"@prisma/debug": "5.7.0",
"@prisma/engines-version": "5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9",
"@prisma/get-platform": "5.7.0"
}
},
"node_modules/@prisma/get-platform": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.7.0.tgz",
"integrity": "sha512-ZeV/Op4bZsWXuw5Tg05WwRI8BlKiRFhsixPcAM+5BKYSiUZiMKIi713tfT3drBq8+T0E1arNZgYSA9QYcglWNA==",
"devOptional": true,
"dependencies": {
"@prisma/debug": "5.7.0"
}
}, },
"node_modules/@sapphire/async-queue": { "node_modules/@sapphire/async-queue": {
"version": "1.5.0", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.1.tgz",
"integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==", "integrity": "sha512-1RdpsmDQR/aWfp8oJzPtn4dNQrbpqSL5PIA0uAB/XwerPXUf994Ug1au1e7uGcD7ei8/F63UDjr5GWps1g/HxQ==",
"engines": { "engines": {
"node": ">=v14.0.0", "node": ">=v14.0.0",
"npm": ">=7.0.0" "npm": ">=7.0.0"
} }
}, },
"node_modules/@sapphire/shapeshift": { "node_modules/@sapphire/shapeshift": {
"version": "3.9.3", "version": "3.9.4",
"resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.3.tgz", "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.4.tgz",
"integrity": "sha512-WzKJSwDYloSkHoBbE8rkRW8UNKJiSRJ/P8NqJ5iVq7U2Yr/kriIBx2hW+wj2Z5e5EnXL1hgYomgaFsdK6b+zqQ==", "integrity": "sha512-SiOoCBmm8O7QuadLJnX4V0tAkhC54NIOZJtmvw+5zwnHaiulGkjY02wxCuK8Gf4V540ILmGz+UulC0U8mrOZjg==",
"dependencies": { "dependencies": {
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"lodash": "^4.17.21" "lodash": "^4.17.21"
@ -341,9 +371,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.9.0", "version": "20.10.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz",
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==",
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
} }
@ -358,18 +388,18 @@
} }
}, },
"node_modules/@types/require-directory": { "node_modules/@types/require-directory": {
"version": "2.1.5", "version": "2.1.6",
"resolved": "https://registry.npmjs.org/@types/require-directory/-/require-directory-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@types/require-directory/-/require-directory-2.1.6.tgz",
"integrity": "sha512-B/kSTngEG3Z9UBW6PzAfduZ4rJVGsjb72e2XWQjqACroSXBZE5NG1A1r9fPx93njitqQwD+FDT6DXMr1shI7XQ==", "integrity": "sha512-b+IXLaj2/pjPLBi7z/0Y5rSWAwn73w4u0Om7dHl0z2RL+ZNOeIfosrGd/bLEeUpcSSuUzOXgF1RrshzLEx9+7Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/semver": { "node_modules/@types/semver": {
"version": "7.5.5", "version": "7.5.6",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz",
"integrity": "sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==", "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==",
"dev": true "dev": true
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
@ -381,16 +411,16 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz",
"integrity": "sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==", "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.5.1", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "6.10.0", "@typescript-eslint/scope-manager": "6.14.0",
"@typescript-eslint/type-utils": "6.10.0", "@typescript-eslint/type-utils": "6.14.0",
"@typescript-eslint/utils": "6.10.0", "@typescript-eslint/utils": "6.14.0",
"@typescript-eslint/visitor-keys": "6.10.0", "@typescript-eslint/visitor-keys": "6.14.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.4", "ignore": "^5.2.4",
@ -416,15 +446,15 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz",
"integrity": "sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==", "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "6.10.0", "@typescript-eslint/scope-manager": "6.14.0",
"@typescript-eslint/types": "6.10.0", "@typescript-eslint/types": "6.14.0",
"@typescript-eslint/typescript-estree": "6.10.0", "@typescript-eslint/typescript-estree": "6.14.0",
"@typescript-eslint/visitor-keys": "6.10.0", "@typescript-eslint/visitor-keys": "6.14.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -444,13 +474,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz",
"integrity": "sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==", "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.10.0", "@typescript-eslint/types": "6.14.0",
"@typescript-eslint/visitor-keys": "6.10.0" "@typescript-eslint/visitor-keys": "6.14.0"
}, },
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -461,13 +491,13 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz",
"integrity": "sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==", "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "6.10.0", "@typescript-eslint/typescript-estree": "6.14.0",
"@typescript-eslint/utils": "6.10.0", "@typescript-eslint/utils": "6.14.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^1.0.1" "ts-api-utils": "^1.0.1"
}, },
@ -488,9 +518,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz",
"integrity": "sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==", "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -501,13 +531,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz",
"integrity": "sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==", "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.10.0", "@typescript-eslint/types": "6.14.0",
"@typescript-eslint/visitor-keys": "6.10.0", "@typescript-eslint/visitor-keys": "6.14.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -528,17 +558,17 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz",
"integrity": "sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==", "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.10.0", "@typescript-eslint/scope-manager": "6.14.0",
"@typescript-eslint/types": "6.10.0", "@typescript-eslint/types": "6.14.0",
"@typescript-eslint/typescript-estree": "6.10.0", "@typescript-eslint/typescript-estree": "6.14.0",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"engines": { "engines": {
@ -553,12 +583,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "6.10.0", "version": "6.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz",
"integrity": "sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==", "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.10.0", "@typescript-eslint/types": "6.14.0",
"eslint-visitor-keys": "^3.4.1" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
@ -576,9 +606,9 @@
"dev": true "dev": true
}, },
"node_modules/@vladfrangu/async_event_emitter": { "node_modules/@vladfrangu/async_event_emitter": {
"version": "2.2.2", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz", "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.4.tgz",
"integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==", "integrity": "sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==",
"engines": { "engines": {
"node": ">=v14.0.0", "node": ">=v14.0.0",
"npm": ">=7.0.0" "npm": ">=7.0.0"
@ -868,9 +898,9 @@
"integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==" "integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw=="
}, },
"node_modules/discord.js": { "node_modules/discord.js": {
"version": "14.14.0", "version": "14.14.1",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.0.tgz", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz",
"integrity": "sha512-ovreSRM365CLfKnfdxB2j56kPnE9lysZS0ZushWCOqFzg1i0jhtA7TbWGFVVqSDP6HVSElNpxhINCdfCVwsaNw==", "integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==",
"dependencies": { "dependencies": {
"@discordjs/builders": "^1.7.0", "@discordjs/builders": "^1.7.0",
"@discordjs/collection": "1.5.3", "@discordjs/collection": "1.5.3",
@ -916,15 +946,15 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.53.0", "version": "8.55.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz",
"integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1", "@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.3", "@eslint/eslintrc": "^2.1.4",
"@eslint/js": "8.53.0", "@eslint/js": "8.55.0",
"@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/config-array": "^0.11.13",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
@ -1160,9 +1190,9 @@
} }
}, },
"node_modules/flat-cache": { "node_modules/flat-cache": {
"version": "3.1.1", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
"integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"flatted": "^3.2.9", "flatted": "^3.2.9",
@ -1170,7 +1200,7 @@
"rimraf": "^3.0.2" "rimraf": "^3.0.2"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": "^10.12.0 || >=12.0.0"
} }
}, },
"node_modules/flatted": { "node_modules/flatted": {
@ -1264,9 +1294,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "13.23.0", "version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@ -1327,9 +1357,9 @@
} }
}, },
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.2.4", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz",
"integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
@ -1522,9 +1552,9 @@
} }
}, },
"node_modules/magic-bytes.js": { "node_modules/magic-bytes.js": {
"version": "1.5.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.5.0.tgz", "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.7.0.tgz",
"integrity": "sha512-wJkXvutRbNWcc37tt5j1HyOK1nosspdh3dj6LUYYAvF6JYNqs53IfRvK9oEpcwiDA1NdoIi64yAMfdivPeVAyw==" "integrity": "sha512-YzVU2+/hrjwx8xcgAw+ffNq3jkactpj+f1iSL4LonrFKhvnwDzHSqtFdk/MMRP53y9ScouJ7cKEnqYsJwsHoYA=="
}, },
"node_modules/md5": { "node_modules/md5": {
"version": "2.3.0", "version": "2.3.0",
@ -1647,9 +1677,9 @@
} }
}, },
"node_modules/openai": { "node_modules/openai": {
"version": "4.17.4", "version": "4.21.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-4.17.4.tgz", "resolved": "https://registry.npmjs.org/openai/-/openai-4.21.0.tgz",
"integrity": "sha512-ThRFkl6snLbcAKS58St7N3CaKuI5WdYUvIjPvf4s+8SdymgNtOfzmZcZXVcCefx04oKFnvZJvIcTh3eAFUUhAQ==", "integrity": "sha512-HT0Jm2iGI5+Maq7Da/DPTeIAxNvpa5pamkhlNnJJAqJgVjaFDvMUBjGhFJoVohkYWwZjM9oSyfSC0eoVNPioaQ==",
"dependencies": { "dependencies": {
"@types/node": "^18.11.18", "@types/node": "^18.11.18",
"@types/node-fetch": "^2.6.4", "@types/node-fetch": "^2.6.4",
@ -1666,9 +1696,9 @@
} }
}, },
"node_modules/openai/node_modules/@types/node": { "node_modules/openai/node_modules/@types/node": {
"version": "18.18.9", "version": "18.19.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.3.tgz",
"integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", "integrity": "sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==",
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
} }
@ -1790,13 +1820,13 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "5.5.2", "version": "5.7.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.5.2.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.7.0.tgz",
"integrity": "sha512-WQtG6fevOL053yoPl6dbHV+IWgKo25IRN4/pwAGqcWmg7CrtoCzvbDbN9fXUc7QS2KK0LimHIqLsaCOX/vHl8w==", "integrity": "sha512-0rcfXO2ErmGAtxnuTNHQT9ztL0zZheQjOI/VNJzdq87C3TlGPQtMqtM+KCwU6XtmkoEr7vbCQqA7HF9IY0ST+Q==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@prisma/engines": "5.5.2" "@prisma/engines": "5.7.0"
}, },
"bin": { "bin": {
"prisma": "build/index.js" "prisma": "build/index.js"
@ -2050,9 +2080,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.2.2", "version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"

View file

@ -6,12 +6,12 @@
"scripts": { "scripts": {
"start": "tsc && node dist/src/index.js", "start": "tsc && node dist/src/index.js",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"publishCommands": "tsc && node dist/src/scripts/pushCommands.js" "publishCommands": "tsc && node dist/scripts/pushCommands.js"
}, },
"author": "Wroclaw", "author": "Wroclaw",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@prisma/client": "5.5.2", "@prisma/client": "5.7.0",
"discord.js": "^14.8.0", "discord.js": "^14.8.0",
"fold-to-ascii": "^5.0.1", "fold-to-ascii": "^5.0.1",
"gpt-3-encoder": "^1.1.4", "gpt-3-encoder": "^1.1.4",
@ -25,6 +25,6 @@
"@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0", "@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.46.0", "eslint": "^8.46.0",
"prisma": "5.5.2" "prisma": "5.7.0"
} }
} }

View file

@ -1,23 +1,29 @@
// https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands // https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands
import { REST, RESTGetAPIOAuth2CurrentApplicationResult, RESTPostAPIApplicationCommandsJSONBody, Routes } from "discord.js"; import { REST, RESTGetAPIOAuth2CurrentApplicationResult, RESTPostAPIApplicationCommandsJSONBody, Routes } from "discord.js";
import { config } from "../index"; import { config } from "../src/index";
import requireDirectory from "require-directory"; import requireDirectory from "require-directory";
import Command from "../command"; import Command from "../src/command";
const post: RESTPostAPIApplicationCommandsJSONBody[] = []; const post: RESTPostAPIApplicationCommandsJSONBody[] = [];
const guildId = process.argv.slice(2)[0]; const guildId = process.argv.slice(2)[0];
requireDirectory<{default: Command}, void>(module, "../commands", { const importedCommands = requireDirectory(module, "../src/commands");
visit: function (obj) {
console.log(obj); for (const obj in importedCommands) {
try {
const allExports = importedCommands[obj] as {default: unknown};
const defaultExport = allExports.default;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call const constructedExport = new defaultExport() as unknown;
post.push(new obj.default().toRESTPostApplicationCommands()); if (!(constructedExport instanceof Command)) throw new Error(`${obj}'s default does not extends Command`);
}, post.push(constructedExport.toRESTPostApplicationCommands());
}); } catch (e) {
console.error(e);
}
}
const rest = new REST().setToken(config.tokens.Discord); const rest = new REST().setToken(config.tokens.Discord);
@ -37,6 +43,8 @@ const rest = new REST().setToken(config.tokens.Discord);
); );
} }
console.log("Refreshed successfully"); console.log("Refreshed successfully");
process.exit(0);
})().catch( e => { })().catch( e => {
console.error(e); console.error(e);
process.exit(1);
}); });

View file

@ -4,12 +4,12 @@ let
# Updating this package will force an update for nodePackages.prisma. The # Updating this package will force an update for nodePackages.prisma. The
# version of prisma-engines and nodePackages.prisma must be the same for them to # version of prisma-engines and nodePackages.prisma must be the same for them to
# function correctly. # function correctly.
prisma-version = "5.5.2"; prisma-version = "5.7.0";
prisma-src = pkgs.fetchFromGitHub { prisma-src = pkgs.fetchFromGitHub {
owner = "prisma"; owner = "prisma";
repo = "prisma-engines"; repo = "prisma-engines";
rev = prisma-version; rev = prisma-version;
hash = "sha256-d24b+Jobt5+vH7SGYOnDIR9DOtM0Y2XSfHZGkr7EidA="; hash = "sha256-gZEz0UtgNwumsZbweAyx3TOVHJshpBigc9pzWN7Gb/A=";
}; };
new-prisma-engines = pkgs.rustPlatform.buildRustPackage { new-prisma-engines = pkgs.rustPlatform.buildRustPackage {
pname = "prisma-engines"; pname = "prisma-engines";
@ -30,6 +30,7 @@ let
cargoLock = { cargoLock = {
lockFile = "${prisma-src}/Cargo.lock"; lockFile = "${prisma-src}/Cargo.lock";
outputHashes = { outputHashes = {
"cuid-1.3.2" = "sha256-ZihFrLerEIOdbJggaBbByRbC1sZRvF4M0LN2albB7vA=";
"barrel-0.6.6-alpha.0" = "sha256-USh0lQ1z+3Spgc69bRFySUzhuY79qprLlEExTmYWFN8="; "barrel-0.6.6-alpha.0" = "sha256-USh0lQ1z+3Spgc69bRFySUzhuY79qprLlEExTmYWFN8=";
"graphql-parser-0.3.0" = "sha256-0ZAsj2mW6fCLhwTETucjbu4rPNzfbNiHu2wVTBlTNe4="; "graphql-parser-0.3.0" = "sha256-0ZAsj2mW6fCLhwTETucjbu4rPNzfbNiHu2wVTBlTNe4=";
"mysql_async-0.31.3" = "sha256-QIO9s0Upc0/1W7ux1RNJNGKqzO4gB4gMV3NoakAbxkQ="; "mysql_async-0.31.3" = "sha256-QIO9s0Upc0/1W7ux1RNJNGKqzO4gB4gMV3NoakAbxkQ=";

View file

@ -4,13 +4,13 @@ import Command from "../command";
import { config } from "../index"; import { config } from "../index";
export default class MyLimit extends Command implements Command { export default class MyLimit extends Command implements Command {
name = "check-limit"; name = "check-quota";
description = "Checks your limit and usage"; description = "Checks your quota and usage";
type = ApplicationCommandType.ChatInput; type = ApplicationCommandType.ChatInput;
options: APIApplicationCommandOption[] = [ options: APIApplicationCommandOption[] = [
{ {
name: "recovery-for", name: "recovery-for",
description: "Calculate the limit recovery time for given message count (default: amount required to use the bot again or 1)", description: "Get the recovery time for given quota units count (default: until can use the bot or 1)",
type: ApplicationCommandOptionType.Integer, type: ApplicationCommandOptionType.Integer,
required: false, required: false,
}, },
@ -18,6 +18,7 @@ export default class MyLimit extends Command implements Command {
name: "ephemeral", name: "ephemeral",
description: "if true, only you can see the response (default true)", description: "if true, only you can see the response (default true)",
type: ApplicationCommandOptionType.Boolean, type: ApplicationCommandOptionType.Boolean,
required: false,
} }
]; ];

View file

@ -1,6 +1,7 @@
{ {
"include": [ "include": [
"./src/**/*" "./src/**/*",
"./scripts/**/*"
], ],
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "ES2022",