@@ -29,12 +29,15 @@ export class OneBotMessageEncoder<C extends Context = Context> extends MessageEn
2929 ? Universal . Channel . Type . DIRECT
3030 : Universal . Channel . Type . TEXT
3131 }
32- if ( ! this . guildId && ! this . session . isDirect ) this . guildId = this . channelId
32+ if ( ! this . session . isDirect ) {
33+ this . session . guildId ??= this . channelId
34+ }
3335 }
3436
3537 async forward ( ) {
3638 if ( ! this . stack [ 0 ] . children . length ) return
3739 const session = this . bot . session ( )
40+ session . content = ''
3841 session . messageId = this . session . event . channel . type === Universal . Channel . Type . DIRECT
3942 ? '' + await this . bot . internal . sendPrivateForwardMsg ( this . channelId . slice ( PRIVATE_PFX . length ) , this . stack [ 0 ] . children )
4043 : '' + await this . bot . internal . sendGroupForwardMsg ( this . channelId , this . stack [ 0 ] . children )
@@ -93,8 +96,9 @@ export class OneBotMessageEncoder<C extends Context = Context> extends MessageEn
9396 }
9497
9598 const session = this . bot . session ( )
99+ session . content = ''
96100 session . messageId = this . bot . parent
97- ? '' + await this . bot . internal . sendGuildChannelMsg ( this . guildId , this . channelId , this . children )
101+ ? '' + await this . bot . internal . sendGuildChannelMsg ( this . session . guildId , this . channelId , this . children )
98102 : this . session . event . channel . type === Universal . Channel . Type . DIRECT
99103 ? '' + await this . bot . internal . sendPrivateMsg ( this . channelId . slice ( PRIVATE_PFX . length ) , this . children )
100104 : '' + await this . bot . internal . sendGroupMsg ( this . channelId , this . children )
@@ -128,6 +132,7 @@ export class OneBotMessageEncoder<C extends Context = Context> extends MessageEn
128132 const session = this . bot . session ( )
129133 // 相关 API 没有返回 message_id
130134 session . messageId = ''
135+ session . content = ''
131136 session . userId = this . bot . selfId
132137 session . channelId = this . session . channelId
133138 session . guildId = this . session . guildId
0 commit comments