@dcrays/dcgchat-test 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/channel.ts +5 -4
- package/src/utils/global.ts +1 -1
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -163,14 +163,15 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
|
|
|
163
163
|
wsSendRaw(newCtx, { response: ctx.text, is_finish: -1, message_tags: { source: 'channel' } })
|
|
164
164
|
dcgLogger(`channel sendText to ${ctx.to} ${ctx.text?.slice(0, 50)}`)
|
|
165
165
|
} else {
|
|
166
|
-
const sessionInfo = ctx.to.split(':')
|
|
167
|
-
const sessionId = sessionInfo.
|
|
168
|
-
const agentId = sessionInfo.
|
|
166
|
+
const sessionInfo = ctx.to.split(':')
|
|
167
|
+
const sessionId = sessionInfo.at(-1) ?? ''
|
|
168
|
+
const agentId = sessionInfo.at(-2) ?? ''
|
|
169
169
|
const merged = mergeDefaultParams({
|
|
170
170
|
agentId: agentId,
|
|
171
171
|
sessionId: `${sessionId}`,
|
|
172
172
|
messageId: messageId,
|
|
173
|
-
is_finish: -1
|
|
173
|
+
is_finish: -1,
|
|
174
|
+
real_mobook: !sessionId ? 1 : ''
|
|
174
175
|
})
|
|
175
176
|
dcgLogger(`channel sendText to ${ctx.to} ${ctx.text?.slice(0, 50)}`)
|
|
176
177
|
wsSendRaw(merged, { response: ctx.text })
|
package/src/utils/global.ts
CHANGED
|
@@ -127,7 +127,7 @@ export const getSessionKey = (content: any, accountId: string) => {
|
|
|
127
127
|
accountId: accountId || 'default',
|
|
128
128
|
peer: { kind: 'direct', id: session_id }
|
|
129
129
|
})
|
|
130
|
-
return real_mobook
|
|
130
|
+
return real_mobook == '1' ? route.sessionKey : `agent:main:mobook:direct:${agent_id}:${session_id}`.toLowerCase()
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
const cronMessageIdMap = new Map<string, string>()
|