Compare commits

...

2 commits

Author SHA1 Message Date
7225739527 Update eslintrc.json to also make it consider typings
note that I've marked Promises awaiting as a warn,
because I don't want to be bothered with it for now.

I also edited all files to accomodate with the new rules.

I should also think find a way to type-safely import Commands directory,
another time
2023-07-30 22:28:13 +02:00
c4676175ff Update dependencies 2023-07-30 21:37:37 +02:00
11 changed files with 176 additions and 212 deletions

View file

@ -1,8 +1,15 @@
{ {
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended-type-checked"],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": { "rules": {
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"@typescript-eslint/semi": ["error", "always"], "@typescript-eslint/semi": ["error", "always"],
"eol-last": ["error", "always"] "semi": "off",
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always"]
} }
} }

318
package-lock.json generated
View file

@ -1,15 +1,15 @@
{ {
"name": "gptcord", "name": "gptcord",
"version": "0.0.1", "version": "0.0.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "gptcord", "name": "gptcord",
"version": "0.0.1", "version": "0.0.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@prisma/client": "^4.13.0", "@prisma/client": "^5.0.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",
@ -19,10 +19,10 @@
"devDependencies": { "devDependencies": {
"@types/fold-to-ascii": "^5.0.0", "@types/fold-to-ascii": "^5.0.0",
"@types/require-directory": "^2.1.2", "@types/require-directory": "^2.1.2",
"@typescript-eslint/eslint-plugin": "^5.55.0", "@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^5.55.0", "@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.36.0", "eslint": "^8.46.0",
"prisma": "^4.13.0", "prisma": "^5.0.0",
"typescript": "^5.1.6" "typescript": "^5.1.6"
} }
}, },
@ -132,18 +132,18 @@
} }
}, },
"node_modules/@eslint-community/regexpp": { "node_modules/@eslint-community/regexpp": {
"version": "4.6.0", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz",
"integrity": "sha512-uiPeRISaglZnaZk8vwrjQZ1CxogZeY/4IYft6gBOTqu1WhVXWmCmZMWxUv2Q/pxSvPdp1JPaO62kLOcOkMqWrw==", "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0" "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.1.0", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz",
"integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
@ -164,9 +164,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.44.0", "version": "8.46.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz",
"integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==",
"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"
@ -241,15 +241,15 @@
} }
}, },
"node_modules/@prisma/client": { "node_modules/@prisma/client": {
"version": "4.16.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.16.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.0.0.tgz",
"integrity": "sha512-qCoEyxv1ZrQ4bKy39GnylE8Zq31IRmm8bNhNbZx7bF2cU5aiCCnSa93J2imF88MBjn7J9eUQneNxUQVJdl/rPQ==", "integrity": "sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@prisma/engines-version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81" "@prisma/engines-version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584"
}, },
"engines": { "engines": {
"node": ">=14.17" "node": ">=16.13"
}, },
"peerDependencies": { "peerDependencies": {
"prisma": "*" "prisma": "*"
@ -261,16 +261,16 @@
} }
}, },
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "4.16.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.16.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.0.0.tgz",
"integrity": "sha512-vx1nxVvN4QeT/cepQce68deh/Turxy5Mr+4L4zClFuK1GlxN3+ivxfuv+ej/gvidWn1cE1uAhW7ALLNlYbRUAw==", "integrity": "sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true "hasInstallScript": true
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
"version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", "version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz",
"integrity": "sha512-q617EUWfRIDTriWADZ4YiWRZXCa/WuhNgLTVd+HqWLffjMSPzyM5uOWoauX91wvQClSKZU4pzI4JJLQ9Kl62Qg==" "integrity": "sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ=="
}, },
"node_modules/@sapphire/async-queue": { "node_modules/@sapphire/async-queue": {
"version": "1.5.0", "version": "1.5.0",
@ -349,32 +349,34 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.2.0.tgz",
"integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "integrity": "sha512-rClGrMuyS/3j0ETa1Ui7s6GkLhfZGKZL3ZrChLeAiACBE/tRc1wq8SNZESUuluxhLj9FkUefRs2l6bCIArWBiQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.2.0",
"@typescript-eslint/type-utils": "5.62.0", "@typescript-eslint/type-utils": "6.2.0",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.2.0",
"@typescript-eslint/visitor-keys": "6.2.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.0", "ignore": "^5.2.4",
"natural-compare": "^1.4.0",
"natural-compare-lite": "^1.4.0", "natural-compare-lite": "^1.4.0",
"semver": "^7.3.7", "semver": "^7.5.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha",
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -383,25 +385,26 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.0.tgz",
"integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "integrity": "sha512-igVYOqtiK/UsvKAmmloQAruAdUHihsOCvplJpplPZ+3h4aDkC/UKZZNKgB6h93ayuYLuEymU3h8nF1xMRbh37g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.2.0",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.2.0",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.2.0",
"@typescript-eslint/visitor-keys": "6.2.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -410,16 +413,16 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.0.tgz",
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "integrity": "sha512-1ZMNVgm5nnHURU8ZSJ3snsHzpFeNK84rdZjluEVBGNu7jDymfqceB3kdIZ6A4xCfEFFhRIB6rF8q/JIqJd2R0Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.2.0",
"@typescript-eslint/visitor-keys": "5.62.0" "@typescript-eslint/visitor-keys": "6.2.0"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -427,25 +430,25 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.2.0.tgz",
"integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "integrity": "sha512-DnGZuNU2JN3AYwddYIqrVkYW0uUQdv0AY+kz2M25euVNlujcN2u+rJgfJsBFlUEzBB6OQkUqSZPyuTLf2bP5mw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.2.0",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.2.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "*" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -454,12 +457,12 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.0.tgz",
"integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "integrity": "sha512-1nRRaDlp/XYJQLvkQJG5F3uBTno5SHPT7XVcJ5n1/k2WfNI28nJsvLakxwZRNY5spuatEKO7d5nZWsQpkqXwBA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -467,21 +470,21 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.0.tgz",
"integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "integrity": "sha512-Mts6+3HQMSM+LZCglsc2yMIny37IhUgp1Qe8yJUYVyO6rHP7/vN0vajKu3JvHCBIy8TSiKddJ/Zwu80jhnGj1w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.2.0",
"@typescript-eslint/visitor-keys": "5.62.0", "@typescript-eslint/visitor-keys": "6.2.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",
"semver": "^7.3.7", "semver": "^7.5.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -494,42 +497,41 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.2.0.tgz",
"integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "integrity": "sha512-RCFrC1lXiX1qEZN8LmLrxYRhOkElEsPKTVSNout8DMzf8PeWoQG7Rxz2SadpJa3VSh5oYKGwt7j7X/VRg+Y3OQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.3.12", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.2.0",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.2.0",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.2.0",
"eslint-scope": "^5.1.1", "semver": "^7.5.4"
"semver": "^7.3.7"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "5.62.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.0.tgz",
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "integrity": "sha512-QbaYUQVKKo9bgCzpjz45llCfwakyoxHetIy8CAvYCtd16Zu1KrpzNHofwF8kGkpPOxZB2o6kz+0nqH8ZkIzuoQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.2.0",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -844,27 +846,27 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.45.0", "version": "8.46.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz",
"integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.0", "@eslint/eslintrc": "^2.1.1",
"@eslint/js": "8.44.0", "@eslint/js": "^8.46.0",
"@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/config-array": "^0.11.10",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
"ajv": "^6.10.0", "ajv": "^6.12.4",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"cross-spawn": "^7.0.2", "cross-spawn": "^7.0.2",
"debug": "^4.3.2", "debug": "^4.3.2",
"doctrine": "^3.0.0", "doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"eslint-scope": "^7.2.0", "eslint-scope": "^7.2.2",
"eslint-visitor-keys": "^3.4.1", "eslint-visitor-keys": "^3.4.2",
"espree": "^9.6.0", "espree": "^9.6.1",
"esquery": "^1.4.2", "esquery": "^1.4.2",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
@ -898,34 +900,9 @@
} }
}, },
"node_modules/eslint-scope": { "node_modules/eslint-scope": {
"version": "5.1.1", "version": "7.2.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true,
"dependencies": {
"esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/eslint-visitor-keys": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz",
"integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint/node_modules/eslint-scope": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz",
"integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esrecurse": "^4.3.0", "esrecurse": "^4.3.0",
@ -938,13 +915,16 @@
"url": "https://opencollective.com/eslint" "url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/eslint/node_modules/estraverse": { "node_modules/eslint-visitor-keys": {
"version": "5.3.0", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=4.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/espree": { "node_modules/espree": {
@ -976,15 +956,6 @@
"node": ">=0.10" "node": ">=0.10"
} }
}, },
"node_modules/esquery/node_modules/estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true,
"engines": {
"node": ">=4.0"
}
},
"node_modules/esrecurse": { "node_modules/esrecurse": {
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
@ -997,7 +968,7 @@
"node": ">=4.0" "node": ">=4.0"
} }
}, },
"node_modules/esrecurse/node_modules/estraverse": { "node_modules/estraverse": {
"version": "5.3.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
@ -1006,15 +977,6 @@
"node": ">=4.0" "node": ">=4.0"
} }
}, },
"node_modules/estraverse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"dev": true,
"engines": {
"node": ">=4.0"
}
},
"node_modules/esutils": { "node_modules/esutils": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
@ -1697,20 +1659,19 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "4.16.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.16.2.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.0.0.tgz",
"integrity": "sha512-SYCsBvDf0/7XSJyf2cHTLjLeTLVXYfqp7pG5eEVafFLeT0u/hLFz/9W196nDRGUOo1JfPatAEb+uEnTQImQC1g==", "integrity": "sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@prisma/engines": "4.16.2" "@prisma/engines": "5.0.0"
}, },
"bin": { "bin": {
"prisma": "build/index.js", "prisma": "build/index.js"
"prisma2": "build/index.js"
}, },
"engines": { "engines": {
"node": ">=14.17" "node": ">=16.13"
} }
}, },
"node_modules/punycode": { "node_modules/punycode": {
@ -2001,6 +1962,18 @@
"url": "https://github.com/sponsors/Borewit" "url": "https://github.com/sponsors/Borewit"
} }
}, },
"node_modules/ts-api-utils": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz",
"integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==",
"dev": true,
"engines": {
"node": ">=16.13.0"
},
"peerDependencies": {
"typescript": ">=4.2.0"
}
},
"node_modules/ts-mixer": { "node_modules/ts-mixer": {
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz",
@ -2011,27 +1984,6 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
"integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA=="
}, },
"node_modules/tsutils": {
"version": "3.21.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
"integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
"dev": true,
"dependencies": {
"tslib": "^1.8.1"
},
"engines": {
"node": ">= 6"
},
"peerDependencies": {
"typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
}
},
"node_modules/tsutils/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

View file

@ -1,6 +1,6 @@
{ {
"name": "gptcord", "name": "gptcord",
"version": "0.0.1", "version": "0.0.2",
"description": "", "description": "",
"main": "./dist/index.js", "main": "./dist/index.js",
"scripts": { "scripts": {
@ -11,7 +11,7 @@
"author": "Wroclaw", "author": "Wroclaw",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@prisma/client": "^4.13.0", "@prisma/client": "^5.0.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",
@ -21,10 +21,10 @@
"devDependencies": { "devDependencies": {
"@types/fold-to-ascii": "^5.0.0", "@types/fold-to-ascii": "^5.0.0",
"@types/require-directory": "^2.1.2", "@types/require-directory": "^2.1.2",
"@typescript-eslint/eslint-plugin": "^5.55.0", "@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^5.55.0", "@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.36.0", "eslint": "^8.46.0",
"prisma": "^4.13.0", "prisma": "^5.0.0",
"typescript": "^5.1.6" "typescript": "^5.1.6"
} }
} }

View file

@ -10,7 +10,7 @@ export default class Summon extends Command {
type = ApplicationCommandType.ChatInput; type = ApplicationCommandType.ChatInput;
dm_permission = false; dm_permission = false;
async execute(interaction: ChatInputCommandInteraction) { execute(interaction: ChatInputCommandInteraction) {
queueRequest(interaction); return queueRequest(interaction);
} }
} }

View file

@ -134,9 +134,9 @@ function canReplyToRequest(request: apiRequest) {
export async function queueRequest(request: apiRequest) { export async function queueRequest(request: apiRequest) {
if (!request.channelId) { if (!request.channelId) {
if (request instanceof DiscordApi.Message) if (request instanceof DiscordApi.Message)
request.reply("request does not have channelId"); await request.reply("request does not have channelId");
else if (request.isRepliable()) else if (request.isRepliable())
request.reply("request does not have channelId"); await request.reply("request does not have channelId");
console.log("There was incoming execution without channelId set, ignoring"); console.log("There was incoming execution without channelId set, ignoring");
console.log(request); console.log(request);
return; return;
@ -148,7 +148,7 @@ export async function queueRequest(request: apiRequest) {
if (userLimit !== false && userLimit.remaining <= 0) { if (userLimit !== false && userLimit.remaining <= 0) {
if (request instanceof DiscordApi.Message) { if (request instanceof DiscordApi.Message) {
request.react("🛑").catch(/*it's okay*/); request.react("🛑").catch(() => { /* NOTE: We send an informaton about limit reached in DM */ });
if (!request.author.dmChannel) await request.author.createDM(); if (!request.author.dmChannel) await request.author.createDM();
request.author.dmChannel?.send({ request.author.dmChannel?.send({
embeds: [{ embeds: [{
@ -157,13 +157,13 @@ export async function queueRequest(request: apiRequest) {
"You've used up your message limit for today,\n" + "You've used up your message limit for today,\n" +
`${userLimit.limit} requests in last 24 hours`, `${userLimit.limit} requests in last 24 hours`,
}] }]
}); }).catch(() => {/* GRACEFAIL: */});
} }
else if (request.isRepliable()) { else if (request.isRepliable()) {
request.reply({ request.reply({
content: `You've used up your message limit for today, ${userLimit.limit} requests in last 24 hours`, content: `You've used up your message limit for today, ${userLimit.limit} requests in last 24 hours`,
ephemeral: true, ephemeral: true,
}); }).catch(() => { /* Impossible to get there unless connection lost*/ });
} }
return; return;
} }
@ -172,7 +172,7 @@ export async function queueRequest(request: apiRequest) {
request.channelId, request.channelId,
() => { return []; }, () => { return []; },
); );
const shouldStart = messagesForChannel.length == 0; const shouldStart = messagesForChannel.length === 0;
messagesForChannel.push(request as request); messagesForChannel.push(request as request);
if (shouldStart) if (shouldStart)
executeFromQueue(request.channelId); executeFromQueue(request.channelId);
@ -191,7 +191,7 @@ function logUsedTokens(
) { ) {
const usage = answer.data.usage; const usage = answer.data.usage;
const functionName = answer.data.choices[0].message?.function_call?.name; const functionName = answer.data.choices[0].message?.function_call?.name;
if (usage != undefined) { if (usage !== undefined) {
const channelName: string = !message.channel.isDMBased() ? `${message.channel.name} (${message.guild?.name})` : `@${getAuthor(message).tag}`; const channelName: string = !message.channel.isDMBased() ? `${message.channel.name} (${message.guild?.name})` : `@${getAuthor(message).tag}`;
console.log(`Used ${usage.total_tokens} (${usage.prompt_tokens} + ${usage.completion_tokens}) tokens for ${getAuthor(message).tag} (${getAuthor(message).id}) in #${channelName}${functionName ? " [Function: " + functionName + "]" : ""}`); console.log(`Used ${usage.total_tokens} (${usage.prompt_tokens} + ${usage.completion_tokens}) tokens for ${getAuthor(message).tag} (${getAuthor(message).id}) in #${channelName}${functionName ? " [Function: " + functionName + "]" : ""}`);
@ -231,7 +231,7 @@ async function executeFromQueue(channel: string) {
messages = messages.filter(m => message.createdTimestamp - m.createdTimestamp < config.limits.time ); messages = messages.filter(m => message.createdTimestamp - m.createdTimestamp < config.limits.time );
messages.forEach(m => Moderation.checkMessage(m)); messages.forEach(m => { Moderation.checkMessage(m); });
if (message instanceof DiscordApi.Message) { if (message instanceof DiscordApi.Message) {
message.channel.sendTyping(); message.channel.sendTyping();
@ -269,7 +269,7 @@ async function executeFromQueue(channel: string) {
const answerContent = answer.data.choices[0].message?.content; const answerContent = answer.data.choices[0].message?.content;
if (answerContent == undefined || answerContent == "") { if (answerContent === undefined || answerContent === "") {
if (message instanceof DiscordApi.Message) message.react("😶").catch(/*it's okay*/); if (message instanceof DiscordApi.Message) message.react("😶").catch(/*it's okay*/);
} }
else { else {
@ -293,7 +293,7 @@ async function executeFromQueue(channel: string) {
} catch (e) { } catch (e) {
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`); console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
console.error(e); console.error(e);
if (OpenAImessages.length != 0) { if (OpenAImessages.length !== 0) {
console.error("Messages:"); console.error("Messages:");
console.error(OpenAImessages); console.error(OpenAImessages);
} }
@ -319,7 +319,7 @@ async function executeFromQueue(channel: string) {
} }
channelQueue.shift(); channelQueue.shift();
if (channelQueue.length == 0) if (channelQueue.length === 0)
channelsRunning.delete(channel); channelsRunning.delete(channel);
else else
executeFromQueue(channel); executeFromQueue(channel);

View file

@ -76,15 +76,18 @@ export default class FunctionManager {
} }
try { try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
parsedArguments = JSON.parse(request.arguments ?? ""); parsedArguments = JSON.parse(request.arguments ?? "");
} }
catch (e) { catch (e) {
console.error("Function arguments raw: " + request.arguments); console.error("Function arguments raw: " + request.arguments);
throw new Error(`Failed to parse the function JSON arguments when running function [${request.name}]`, {cause: e}); throw new Error(`Failed to parse the function JSON arguments when running function [${request.name}]`, {cause: e});
} }
// FIXME: Verify if the parsedArguments matches the requested function argument declaration.
return { return {
role: "function", role: "function",
name: request.name, name: request.name,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
content: functionToRun.execute(parsedArguments), content: functionToRun.execute(parsedArguments),
}; };
} }

View file

@ -23,11 +23,11 @@ export const database = new PrismaClient();
const interactionManager = new InteractionManager(); const interactionManager = new InteractionManager();
interactionManager.bindClient(discord); interactionManager.bindClient(discord);
discord.on("ready", async event => { discord.on("ready", event => {
console.log(`Connected to Discord as ${event.user.tag} (${event.user.id})`); console.log(`Connected to Discord as ${event.user.tag} (${event.user.id})`);
}); });
discord.on("messageCreate", async message => { discord.on("messageCreate", message => {
if (message.author.bot) return; if (message.author.bot) return;
if (!message.mentions.has(message.client.user)) return; if (!message.mentions.has(message.client.user)) return;

View file

@ -12,6 +12,7 @@ export default class CommandManager {
try { try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
this.commands.push(new (files[i].default as Command)()); this.commands.push(new (files[i].default as Command)());
} }
catch (e) { catch (e) {
@ -27,13 +28,13 @@ export default class CommandManager {
interaction.isMessageContextMenuCommand() || interaction.isMessageContextMenuCommand() ||
interaction.isUserContextMenuCommand() interaction.isUserContextMenuCommand()
) { ) {
const foundCommand = this.commands.find((command) => command.name == interaction.commandName ); const foundCommand = this.commands.find((command) => command.name === interaction.commandName );
if (!foundCommand) throw new Error(`Unknown command received (${interaction.commandName}). Did you forgot to push updated commands?`); if (!foundCommand) throw new Error(`Unknown command received (${interaction.commandName}). Did you forgot to push updated commands?`);
foundCommand.execute(interaction); foundCommand.execute(interaction);
return; return;
} }
if (interaction.isAutocomplete()) { if (interaction.isAutocomplete()) {
const foundCommand = this.commands.find((command) => command.name == interaction.commandName ); const foundCommand = this.commands.find((command) => command.name === interaction.commandName );
if (!foundCommand) throw new Error(`Unknown command received (${interaction.commandName}). Did you forgot to push updated commands?`); if (!foundCommand) throw new Error(`Unknown command received (${interaction.commandName}). Did you forgot to push updated commands?`);
if (!foundCommand.autocomplete) return; if (!foundCommand.autocomplete) return;
foundCommand.autocomplete(interaction); foundCommand.autocomplete(interaction);

View file

@ -31,11 +31,11 @@ export default class Moderation {
const flagged = answer.data.results[0].flagged; const flagged = answer.data.results[0].flagged;
this.cache.set(message.id, flagged); this.cache.set(message.id, flagged);
if (flagged) if (message instanceof Message) { if (flagged) if (message instanceof Message) {
message.react("⚠"); message.react("⚠").catch(() => { /* GRACEFAIL: We don't inform the enduser then */ });
} }
else { else {
const channelMessage = await message.fetch(); const channelMessage = await message.fetch();
channelMessage.react("⚠"); channelMessage.react("⚠").catch(() => { /* GRACEFAIL: We don't inform the enduser then */ });
} }
return flagged; return flagged;

View file

@ -14,6 +14,7 @@ requireDirectory<{default: Command}, void>(module, "../commands", {
console.log(obj); console.log(obj);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
post.push(new obj.default().toRESTPostApplicationCommands()); post.push(new obj.default().toRESTPostApplicationCommands());
}, },
}); });
@ -22,7 +23,7 @@ const rest = new REST().setToken(config.tokens.Discord);
(async () => { (async () => {
const me = await rest.get(Routes.oauth2CurrentApplication()) as RESTGetAPIOAuth2CurrentApplicationResult; const me = await rest.get(Routes.oauth2CurrentApplication()) as RESTGetAPIOAuth2CurrentApplicationResult;
if (guildId && guildId != "") { if (guildId && guildId !== "") {
console.log(`Started refreshing ${post.length} application guild (${guildId}) commands.`); console.log(`Started refreshing ${post.length} application guild (${guildId}) commands.`);
await rest.put( await rest.put(
Routes.applicationGuildCommands(me.id, guildId), Routes.applicationGuildCommands(me.id, guildId),

View file

@ -108,7 +108,7 @@ export default function toOpenAIMessages(messages: Collection<string, DiscordMes
tokenCount += countTokens(content); tokenCount += countTokens(content);
if (tokenCount > config.limits.tokens) break; if (tokenCount > config.limits.tokens) break;
rvalue.push({ rvalue.push({
role: message.author.id == message.client.user.id ? "assistant" : "user", role: message.author.id === message.client.user.id ? "assistant" : "user",
content: content, content: content,
name: getAuthorUsername(message), name: getAuthorUsername(message),
}); });