satorijs / satori

The Universal Messenger Protocol
MIT License
151 stars 43 forks source link

bug(无法稳定复现) discord平台无法发送图片 #141

Closed itzdrli closed 1 year ago

itzdrli commented 1 year ago

奇怪的问题 插件源码 有时在discord触发代码中的指令 mcs 时控制台会出现错误:

2023-08-06 23:23:36 [W] app TypeError: Cannot read properties of undefined (reading 'includes')
                            at <anonymous> (/home/fantastic-spoon/node_modules/@koishijs/core/src/permission.ts:126:36)
                            at Array.some (<anonymous>)
                            at _Permissions.test (/home/fantastic-spoon/node_modules/@koishijs/core/src/permission.ts:126:19)
                            at _Session.<anonymous> (/home/fantastic-spoon/node_modules/@koishijs/core/src/command/validate.ts:21:32)
                            at _Lifecycle.serial (/home/fantastic-spoon/node_modules/cordis/src/events.ts:106:37)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at _Command.execute (/home/fantastic-spoon/node_modules/@koishijs/core/src/command/command.ts:270:22)
                            at <anonymous> (/home/fantastic-spoon/node_modules/@koishijs/core/src/session.ts:401:22)
                            at _Session.withScope (/home/fantastic-spoon/node_modules/@koishijs/core/src/session.ts:268:22)
System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (3) x64 AMD EPYC Processor

Binaries:
    Node: 18.17.0
    Yarn: 1.22.19

Koishi:
    Core: 4.14.0
    Console: 5.13.1

在出现了这个问题后哪怕重启也不行,得重新安装koishi(重新创建模板项目) 在碰到问题前干过什么: ctrl-c关闭模板koishi, 进入 external/ , 使用git clone导入我的插件代码, 重命名clone来的文件夹, 返回koishi根目录, 执行 yarn , 然后yarn dev

经测试telegram, onebot平台没有这个问题,只在discord上碰到过,而且碰到两次都是在koishi版本为4.14.0上

如需更多信息我随时补充

shigma commented 1 year ago

重新安装就好了吗?

看起来问题来自于 @koishijs/core。

shigma commented 1 year ago

哦,dc 可以复现是因为 dc 支持了 slash command。大概会修了。

itzdrli commented 1 year ago

补充:今天一早测试发现所有指令都用不了了,都是在发送后bot thinking然后没下文了

shigma commented 1 year ago

最新版应该已经修复了?