@dcrays/dcgchat-test 0.3.12 → 0.3.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/channel.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcrays/dcgchat-test",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for 书灵墨宝 (WebSocket)",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -164,8 +164,9 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
164
164
  dcgLogger(`channel sendText to ${ctx.to} ${ctx.text?.slice(0, 50)}`)
165
165
  } else {
166
166
  const sessionInfo = ctx.to.split(':')[1]
167
- const sessionId = sessionInfo.split('-')[0]
168
- const agentId = sessionInfo.split('-')[1]
167
+ const parts = sessionInfo.split('-')
168
+ const sessionId = parts.at(-1) ?? ''
169
+ const agentId = parts.at(-2) ?? ''
169
170
  const merged = mergeDefaultParams({
170
171
  agentId: agentId,
171
172
  sessionId: `${sessionId}`,