Replies: 3 comments
|
ctx.getBot |
0 replies
|
你可以使用 |
0 replies
其实建议 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
let bot = ctx.bots[0];bot.sendGroupMsg('群号', '1');使用yarn koishi start -- -- -r ts-node/register启动,加载插件时(.ts文件)
TSError: ⨯ Unable to compile TypeScript: plugins/caker.ts:70:29 - error TS2339: Property 'sendGroupMsg' does not exist on type 'Bot<never>'.在vscode里点进看Context的声明也能看到
get bots(): Bot<never>[] & Record<string, Bot<never>>;成员。与文档中描述的Bot[]不同
To Reproduce
Expected behavior
能正常加载插件。或者有什么办法调用sendGroupMsg等bot的接口
Screenshots
Versions
Additional context
在koishi2的时候是正常的,更新到3后就这样,不知道是koishi的特性还是bug,如果是因为我打开姿势错了,希望能得到正确打开方式,打扰了。
然后想问正确的调用ctx中bot是否有推荐的方式,总感觉ctx.bot[0]是很野蛮的做法(
All reactions