chore(services/telegram): replace remeda with es-toolkit
This commit is contained in:
@@ -82,7 +82,6 @@ words:
|
||||
- pixiv
|
||||
- pretrained
|
||||
- rehype
|
||||
- remeda
|
||||
- rushstack
|
||||
- Shadcn
|
||||
- shiki
|
||||
|
||||
Generated
+15
-49
@@ -215,7 +215,7 @@ importers:
|
||||
version: 0.8.2
|
||||
'@gcornut/valibot-json-schema':
|
||||
specifier: ^0.42.0
|
||||
version: 0.42.0(esbuild@0.23.1)(typescript@5.7.3)
|
||||
version: 0.42.0(esbuild@0.24.2)(typescript@5.7.3)
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.3.0
|
||||
version: 3.3.0
|
||||
@@ -281,7 +281,7 @@ importers:
|
||||
version: 2.10.3
|
||||
'@typeschema/valibot':
|
||||
specifier: ^0.14.0
|
||||
version: 0.14.0(@gcornut/valibot-json-schema@0.42.0(esbuild@0.23.1)(typescript@5.7.3))(@types/json-schema@7.0.15)(valibot@1.0.0-beta.9(typescript@5.7.3))
|
||||
version: 0.14.0(@gcornut/valibot-json-schema@0.42.0(esbuild@0.24.2)(typescript@5.7.3))(@types/json-schema@7.0.15)(valibot@1.0.0-beta.9(typescript@5.7.3))
|
||||
'@unhead/vue':
|
||||
specifier: ^1.11.18
|
||||
version: 1.11.18(vue@3.5.13(typescript@5.7.3))
|
||||
@@ -456,7 +456,7 @@ importers:
|
||||
version: 28.0.0(@babel/parser@7.26.3)(@nuxt/kit@3.14.1592(rollup@2.79.1))(rollup@2.79.1)(vue@3.5.13(typescript@5.7.3))
|
||||
unplugin-vue-macros:
|
||||
specifier: ^2.13.8
|
||||
version: 2.13.8(@vueuse/core@12.4.0(typescript@5.7.3))(esbuild@0.23.1)(rollup@2.79.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))(vue-tsc@2.2.0(typescript@5.7.3))(vue@3.5.13(typescript@5.7.3))
|
||||
version: 2.13.8(@vueuse/core@12.4.0(typescript@5.7.3))(esbuild@0.24.2)(rollup@2.79.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))(vue-tsc@2.2.0(typescript@5.7.3))(vue@3.5.13(typescript@5.7.3))
|
||||
unplugin-vue-markdown:
|
||||
specifier: ^28.0.0
|
||||
version: 28.0.0(rollup@2.79.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))
|
||||
@@ -881,15 +881,15 @@ importers:
|
||||
drizzle-orm:
|
||||
specifier: ^0.38.3
|
||||
version: 0.38.3(@types/pg@8.11.10)(pg@8.13.1)(react@18.3.1)
|
||||
es-toolkit:
|
||||
specifier: ^1.31.0
|
||||
version: 1.31.0
|
||||
grammy:
|
||||
specifier: ^1.34.0
|
||||
version: 1.34.0
|
||||
pg:
|
||||
specifier: ^8.13.1
|
||||
version: 8.13.1
|
||||
remeda:
|
||||
specifier: ^2.19.1
|
||||
version: 2.19.1
|
||||
sharp:
|
||||
specifier: ^0.33.5
|
||||
version: 0.33.5
|
||||
@@ -5368,6 +5368,9 @@ packages:
|
||||
resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
es-toolkit@1.31.0:
|
||||
resolution: {integrity: sha512-vwS0lv/tzjM2/t4aZZRAgN9I9TP0MSkWuvt6By+hEXfG/uLs8yg2S1/ayRXH/x3pinbLgVJYT+eppueg3cM6tg==}
|
||||
|
||||
es5-ext@0.10.64:
|
||||
resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==}
|
||||
engines: {node: '>=0.10'}
|
||||
@@ -7849,9 +7852,6 @@ packages:
|
||||
remark-rehype@11.1.1:
|
||||
resolution: {integrity: sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==}
|
||||
|
||||
remeda@2.19.1:
|
||||
resolution: {integrity: sha512-IZ1NwntA2xwksQgn6zRFZB9lsVWW1GoRZZno3UIHE0tUh1B62ZSIhFIDIRssUfgqOBG2kL7g3GXx4e+CK59OPw==}
|
||||
|
||||
require-directory@2.1.1:
|
||||
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -8500,10 +8500,6 @@ packages:
|
||||
resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
type-fest@4.32.0:
|
||||
resolution: {integrity: sha512-rfgpoi08xagF3JSdtJlCwMq9DGNDE0IMh3Mkpc1wUypg9vPi786AiqeBBKcqvIkq42azsBM85N490fyZjeUftw==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
type@2.7.3:
|
||||
resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==}
|
||||
|
||||
@@ -10728,16 +10724,6 @@ snapshots:
|
||||
- esbuild
|
||||
- typescript
|
||||
|
||||
'@gcornut/valibot-json-schema@0.42.0(esbuild@0.23.1)(typescript@5.7.3)':
|
||||
dependencies:
|
||||
valibot: 0.42.1(typescript@5.7.3)
|
||||
optionalDependencies:
|
||||
'@types/json-schema': 7.0.15
|
||||
esbuild-runner: 2.2.2(esbuild@0.23.1)
|
||||
transitivePeerDependencies:
|
||||
- esbuild
|
||||
- typescript
|
||||
|
||||
'@gcornut/valibot-json-schema@0.42.0(esbuild@0.24.2)(typescript@5.7.3)':
|
||||
dependencies:
|
||||
valibot: 0.42.1(typescript@5.7.3)
|
||||
@@ -12083,15 +12069,6 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- '@types/json-schema'
|
||||
|
||||
'@typeschema/valibot@0.14.0(@gcornut/valibot-json-schema@0.42.0(esbuild@0.23.1)(typescript@5.7.3))(@types/json-schema@7.0.15)(valibot@1.0.0-beta.9(typescript@5.7.3))':
|
||||
dependencies:
|
||||
'@typeschema/core': 0.14.0(@types/json-schema@7.0.15)
|
||||
optionalDependencies:
|
||||
'@gcornut/valibot-json-schema': 0.42.0(esbuild@0.23.1)(typescript@5.7.3)
|
||||
valibot: 1.0.0-beta.9(typescript@5.7.3)
|
||||
transitivePeerDependencies:
|
||||
- '@types/json-schema'
|
||||
|
||||
'@typeschema/valibot@0.14.0(@gcornut/valibot-json-schema@0.42.0(esbuild@0.24.2)(typescript@5.7.3))(@types/json-schema@7.0.15)(valibot@1.0.0-beta.9(typescript@5.7.3))':
|
||||
dependencies:
|
||||
'@typeschema/core': 0.14.0(@types/json-schema@7.0.15)
|
||||
@@ -14431,6 +14408,8 @@ snapshots:
|
||||
is-date-object: 1.0.5
|
||||
is-symbol: 1.0.4
|
||||
|
||||
es-toolkit@1.31.0: {}
|
||||
|
||||
es5-ext@0.10.64:
|
||||
dependencies:
|
||||
es6-iterator: 2.0.3
|
||||
@@ -14466,13 +14445,6 @@ snapshots:
|
||||
tslib: 2.4.0
|
||||
optional: true
|
||||
|
||||
esbuild-runner@2.2.2(esbuild@0.23.1):
|
||||
dependencies:
|
||||
esbuild: 0.23.1
|
||||
source-map-support: 0.5.21
|
||||
tslib: 2.4.0
|
||||
optional: true
|
||||
|
||||
esbuild-runner@2.2.2(esbuild@0.24.2):
|
||||
dependencies:
|
||||
esbuild: 0.24.2
|
||||
@@ -17463,10 +17435,6 @@ snapshots:
|
||||
unified: 11.0.5
|
||||
vfile: 6.0.3
|
||||
|
||||
remeda@2.19.1:
|
||||
dependencies:
|
||||
type-fest: 4.32.0
|
||||
|
||||
require-directory@2.1.1: {}
|
||||
|
||||
require-from-string@2.0.2: {}
|
||||
@@ -18218,8 +18186,6 @@ snapshots:
|
||||
|
||||
type-fest@0.8.1: {}
|
||||
|
||||
type-fest@4.32.0: {}
|
||||
|
||||
type@2.7.3: {}
|
||||
|
||||
typed-array-buffer@1.0.0:
|
||||
@@ -18493,12 +18459,12 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- rollup
|
||||
|
||||
unplugin-combine@1.0.3(esbuild@0.23.1)(rollup@2.79.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1)):
|
||||
unplugin-combine@1.0.3(esbuild@0.24.2)(rollup@2.79.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1)):
|
||||
dependencies:
|
||||
'@antfu/utils': 0.7.10
|
||||
unplugin: 1.16.0
|
||||
optionalDependencies:
|
||||
esbuild: 0.23.1
|
||||
esbuild: 0.24.2
|
||||
rollup: 2.79.1
|
||||
vite: 6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1)
|
||||
|
||||
@@ -18569,7 +18535,7 @@ snapshots:
|
||||
- rollup
|
||||
- vue
|
||||
|
||||
unplugin-vue-macros@2.13.8(@vueuse/core@12.4.0(typescript@5.7.3))(esbuild@0.23.1)(rollup@2.79.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))(vue-tsc@2.2.0(typescript@5.7.3))(vue@3.5.13(typescript@5.7.3)):
|
||||
unplugin-vue-macros@2.13.8(@vueuse/core@12.4.0(typescript@5.7.3))(esbuild@0.24.2)(rollup@2.79.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))(vue-tsc@2.2.0(typescript@5.7.3))(vue@3.5.13(typescript@5.7.3)):
|
||||
dependencies:
|
||||
'@vue-macros/better-define': 1.11.1(rollup@2.79.1)(vue@3.5.13(typescript@5.7.3))
|
||||
'@vue-macros/boolean-prop': 0.5.3(rollup@2.79.1)(vue@3.5.13(typescript@5.7.3))
|
||||
@@ -18601,7 +18567,7 @@ snapshots:
|
||||
'@vue-macros/short-vmodel': 1.5.3(rollup@2.79.1)(vue@3.5.13(typescript@5.7.3))
|
||||
'@vue-macros/volar': 0.30.10(rollup@2.79.1)(typescript@5.7.3)(vue-tsc@2.2.0(typescript@5.7.3))(vue@3.5.13(typescript@5.7.3))
|
||||
unplugin: 1.16.0
|
||||
unplugin-combine: 1.0.3(esbuild@0.23.1)(rollup@2.79.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))
|
||||
unplugin-combine: 1.0.3(esbuild@0.24.2)(rollup@2.79.1)(vite@6.0.7(@types/node@22.10.6)(jiti@2.4.0)(less@4.2.1)(terser@5.17.6)(tsx@4.19.2)(yaml@2.6.1))
|
||||
unplugin-vue-define-options: 1.5.3(rollup@2.79.1)(vue@3.5.13(typescript@5.7.3))
|
||||
vue: 3.5.13(typescript@5.7.3)
|
||||
transitivePeerDependencies:
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
"@xsai/tool": "^0.0.27",
|
||||
"dotenv": "^16.4.7",
|
||||
"drizzle-orm": "^0.38.3",
|
||||
"es-toolkit": "^1.31.0",
|
||||
"grammy": "^1.34.0",
|
||||
"pg": "^8.13.1",
|
||||
"remeda": "^2.19.1",
|
||||
"sharp": "^0.33.5",
|
||||
"telegram": "^2.26.16",
|
||||
"valibot": "1.0.0-beta.9"
|
||||
|
||||
@@ -5,8 +5,8 @@ import { env } from 'node:process'
|
||||
import { useLogg } from '@guiiai/logg'
|
||||
import { generateText } from '@xsai/generate-text'
|
||||
import { message } from '@xsai/shared-chat'
|
||||
import { randomInt } from 'es-toolkit'
|
||||
import { Bot } from 'grammy'
|
||||
import { randomInteger } from 'remeda'
|
||||
|
||||
import { openAI } from '../../llm'
|
||||
import { interpretPhotos } from '../../llm/photo'
|
||||
@@ -53,7 +53,7 @@ async function sendMayStructuredMessage(
|
||||
state.currentTask = replyTask
|
||||
const msg = await replyTask.promise
|
||||
await recordMessage(state.bot.botInfo, msg)
|
||||
await sleep(randomInteger(50, 1000))
|
||||
await sleep(randomInt(50, 1000))
|
||||
}
|
||||
}
|
||||
else if (responseText) {
|
||||
|
||||
Reference in New Issue
Block a user