koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug: ctx.broadcast 在携带 channels 参数时无法工作 #1334

Closed MirrorCY closed 10 months ago

MirrorCY commented 10 months ago

Describe the bug

ctx.broadcast 在携带 channels 参数时无法工作,不会发送任何消息。在不带 channels 参数的重载中工作正常。

Steps to reproduce

      console.log(await ctx.broadcast(['!SyoSheYAWsnQNspXMl:my.matrix.host','#'],'测试 sandbox Matrix'))
      console.log(await ctx.broadcast(['#'],'测试 sandbox')) // sandbox
      console.log(await ctx.broadcast(['!SyoSheYAWsnQNspXMl:my.matrix.host'],'测试 Matrix')) // Matrix

Expected behavior

可以正常携带 channels 参数使用

Screenshots

No response

Versions

Additional context

No response

shigma commented 10 months ago

这里的一参数本来就需要 platform 前缀。

MirrorCY commented 10 months ago

https://koishi.chat/zh-CN/api/core/context.html#ctx-broadcast-%E9%9C%80%E8%A6%81%E6%95%B0%E6%8D%AE%E5%BA%93

啊 看来是文档没写清楚,我去改一下)