foliko 1.0.6 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foliko",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "简约的插件化 Agent 框架",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -366,9 +366,12 @@ module.exports = function(Plugin) {
366
366
 
367
367
  const savedMsg = `收到图片${caption ? ': ' + caption : ''}\n已保存至: ${filePath}`
368
368
  await this._sendMessage(chatId, savedMsg, msg.message_id)
369
-
369
+ if(caption){
370
+ const message=`图片:${filePath}, ${caption}`
371
+ await this._processChat(chatId, message, msg.message_id)
372
+ }
370
373
  // TODO: 调用 AI 视觉能力分析图片
371
- // await this._analyzeImage(chatId, filePath, caption)
374
+ // await this._analyzeImage(chatId, filePath, capti on)
372
375
  } catch (err) {
373
376
  console.error('[Telegram] Failed to save photo:', err.message)
374
377
  await this._sendMessage(chatId, '图片保存失败: ' + err.message, msg.message_id)
@@ -399,6 +402,10 @@ module.exports = function(Plugin) {
399
402
 
400
403
  const savedMsg = `收到文件: ${fileName}\n已保存至: ${filePath}${caption ? '\n\n说明: ' + caption : ''}`
401
404
  await this._sendMessage(chatId, savedMsg, msg.message_id)
405
+ if(caption){
406
+ const message=`文件:${filePath}, ${caption}`
407
+ await this._processChat(chatId, message, msg.message_id)
408
+ }
402
409
  } catch (err) {
403
410
  console.error('[Telegram] Failed to save document:', err.message)
404
411
  await this._sendMessage(chatId, '文件保存失败: ' + err.message, msg.message_id)
@@ -435,7 +442,7 @@ module.exports = function(Plugin) {
435
442
  if (savedPath !== finalPath) {
436
443
  fs.renameSync(savedPath, finalPath)
437
444
  }
438
- resolve(finalPath)
445
+ resolve(filePath)
439
446
  })
440
447
  .catch(reject)
441
448
  })