@dcrays/dcgchat-test 0.2.32 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -0
- package/package.json +1 -1
- package/src/bot.ts +10 -4
package/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ const plugin = {
|
|
|
12
12
|
configSchema: emptyPluginConfigSchema(),
|
|
13
13
|
register(api: OpenClawPluginApi) {
|
|
14
14
|
setDcgchatRuntime(api.runtime)
|
|
15
|
+
|
|
16
|
+
console.log('🚀 ~ handleDcgchatMessage ~ process.platform:', process.platform)
|
|
15
17
|
monitoringToolMessage(api)
|
|
16
18
|
setOpenClawConfig(api.config)
|
|
17
19
|
api.registerChannel({ plugin: dcgchatPlugin })
|
package/package.json
CHANGED
package/src/bot.ts
CHANGED
|
@@ -331,11 +331,17 @@ export async function handleDcgchatMessage(msg: InboundMessage, accountId: strin
|
|
|
331
331
|
markDispatchIdle()
|
|
332
332
|
if (![...systemCommand, ...interruptCommand].includes(text?.trim())) {
|
|
333
333
|
for (const file of extractMobookFiles(completeText)) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
334
|
+
const candidates: string[] = [file]
|
|
335
|
+
candidates.push(path.join(getWorkspaceDir(), file))
|
|
336
|
+
candidates.push(path.join(getWorkspaceDir(), file.replace(/^\//, '')))
|
|
337
|
+
if (process.platform === 'win32') {
|
|
338
|
+
const underMobook = file.replace(/^\/mobook\//i, '').replace(/^mobook[\\/]/i, '')
|
|
339
|
+
if (underMobook) {
|
|
340
|
+
candidates.push(path.join('C:\\', 'mobook', underMobook))
|
|
341
|
+
}
|
|
338
342
|
}
|
|
343
|
+
const resolved = candidates.find((p) => fs.existsSync(p))
|
|
344
|
+
if (!resolved) continue
|
|
339
345
|
await sendDcgchatMedia({ msgCtx, mediaUrl: resolved, text: '' })
|
|
340
346
|
}
|
|
341
347
|
}
|