求助 blockly-null群聊广播无反应

根据null演示帖下图片 拼凑了这个插件


沙盒里实验本群回话没有问题 接入bot后实际情况下本群回话也没问题
但是在其他群聊广播无反应 自行尝试修复 拼尽全力也无法战胜()
日志显示收到消息时三条报错

1000|2|2024-07-02 16:13:03 [W] bot TypeError: MessageEncoder2 is not a constructor
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Proxy.sendMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@satorijs\core\lib\index.cjs::)
1000|2|                            at Proxy.broadcast (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:2:60)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1000|2|                            at Command.eval (eval at <anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\koishi-plugin-blockly-null\lib\plugin.js::40), <anonymous>:7:23)
1000|2|                            at async Array.<anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1114:14)
1000|2|                            at Proxy.createMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@satorijs\core\lib\index.cjs::12)
1000|2|2024-07-02 16:13:04 [W] bot TypeError: MessageEncoder2 is not a constructor
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Proxy.sendMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@satorijs\core\lib\index.cjs::)
1000|2|                            at Proxy.broadcast (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:2:60)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at async Array.<anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1114:14)
1000|2|                            at async Command.eval (eval at <anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\koishi-plugin-blockly-null\lib\plugin.js::40), <anonymous>:7:5)
1000|2|                            at async Command.execute (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1128:22)
1000|2|                            at Proxy.createMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@satorijs\core\lib\index.cjs::12)
1000|2|2024-07-02 16:13:04 [W] bot TypeError: MessageEncoder2 is not a constructor
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at Proxy.sendMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@satorijs\core\lib\index.cjs::)
1000|2|                            at Proxy.broadcast (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:2:178)
1000|2|                            at Object.apply (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@cordisjs\core\lib\index.cjs:176:40)
1000|2|                            at async Array.<anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1114:14)
1000|2|                            at async Command.eval (eval at <anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\koishi-plugin-blockly-null\lib\plugin.js::40), <anonymous>:7:5)
1000|2|                            at async Command.execute (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1128:22)
1 个赞

广播块的代码session.bot.broadcast :melting_face:
好像在某个更新后变成了这个。


你先这样

凑合凑合

1 个赞

改完后日志不报错了

1000|2|2024-07-02 23:24:06 [W] command test 
1000|2|                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1000|2|                            at Command.eval (eval at <anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\koishi-plugin-blockly-null\lib\plugin.js::40), <anonymous>:7:5)
1000|2|                            at async Command.execute (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1128:22)
1000|2|                            at async Array.<anonymous> (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:1114:14)
1000|2|                            at async Proxy.withScope (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:2065:22)
1000|2|                            at async C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:2162:22
1000|2|                            at async next (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:853:16)
1000|2|                            at async next (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:853:16)
1000|2|                            at async Processor._handleMessage (C:\Users\Administrator\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@koishijs\core\lib\index.cjs:864:22)

但是bot返回了未知错误且没进行广播()


:sob:

1 个赞

改了下设置报错不一样了

1 个赞

挠头,你好像写错了-_-||

1 个赞

确实写错了()
但是修改后仍返回未知错误


1 个赞

bot是从session或者ctx.bot里获取的,所以完整写法就是session.bot.broadcast
bot不是可以直接用的

1 个赞

感谢 :hammer:大记忆恢复术,
CC585FB590C04FB709AE851BA90446C6

1 个赞

更改了代码后确实不报未知错误了 后续逻辑也正确执行了


但是仍然未进行广播 日志弹出了跟用广播块时类似的错误()

1 个赞

尝试修复无果,仍然报错
Cache_-280b08fda1d16009

1 个赞