Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Receiver must be an instance of class MessageService #8

Open
H4M5TER opened this issue Dec 26, 2023 · 0 comments
Open

TypeError: Receiver must be an instance of class MessageService #8

H4M5TER opened this issue Dec 26, 2023 · 0 comments

Comments

@H4M5TER
Copy link

H4M5TER commented Dec 26, 2023

2023-12-26 19:52:49 [E] app TypeError: Receiver must be an instance of class MessageService
                            at MessageService.start (D:\koishi\node_modules\koishi-plugin-messages\lib\index.js:48:37)
                            at D:\koishi\node_modules\cordis\lib\index.cjs:918:18
46    async start() {
47        // 如果是一个 platform 有多个 bot, bot 状态变化, 频道状态变化待解决
48        this.ctx.on('message', this.#onMessage.bind(this));

参考 https://stackoverflow.com/questions/75414798/ 的说法,这个问题是因为在访问 this.#onMessage 时,子类(MessageService)还没有构造完毕导致的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant