-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: group message sendability when using plugin server-satori
#18
Conversation
channelId
channelId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要用 this.channelId.startsWith('private:')
或 this.session.isDirect
- 前者是创建 Session 时才应该使用的方法,在 Session 外部可以调用 Session 的封装来判断
- 后者已被 Satori 协议标准的
session.channel.type
替代,session.channel.type
会在 Satori 协议中传输而isDirect
不会
可能还需要 import { Channel } from 'koishi'
,Apply Suggestion 以后在本地测试一下吧
session.messageId = this.guildId | ||
? '' + await this.bot.internal.sendGroupForwardMsg(this.guildId, this.stack[0].children) | ||
: '' + await this.bot.internal.sendPrivateForwardMsg(this.channelId.slice(8), this.stack[0].children) | ||
session.messageId = this.channelId.startsWith('private:') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session.messageId = this.channelId.startsWith('private:') | |
session.messageId = this.session.channel.type === Channel.Type.DIRECT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是我的koishi版本问题吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你点进去左面的 this.session.channel.type
看下是什么类型,用相同的类型就行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型“Observed”上不存在属性“type”。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实可能是 Koishi 的版本低了,尝试升级下你的 Koishi 版本(也可以新开一个开发环境
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的Koishi版本是4.17.0-beta.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session.event.channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.guildId | ||
? '' + await this.bot.internal.sendGroupMsg(this.guildId, this.children) | ||
: '' + await this.bot.internal.sendPrivateMsg(this.channelId.slice(8), this.children) | ||
: this.channelId.startsWith('private:') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.channelId.startsWith('private:') | |
: this.session.channel.type === Channel.Type.DIRECT |
channelId
server-satori
close due to #20 |
No description provided.