@dcrays/dcgchat 0.3.19 → 0.3.21
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 +1 -2
- package/src/request/api.ts +1 -1
- package/src/request/oss.ts +3 -1
- package/src/transport.ts +2 -1
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -163,10 +163,9 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
|
|
|
163
163
|
sessionId: `${sessionId}`,
|
|
164
164
|
messageId: messageId,
|
|
165
165
|
is_finish: -1,
|
|
166
|
-
message_tags: { source: 'channel' },
|
|
167
166
|
real_mobook: !sessionId ? 1 : ''
|
|
168
167
|
})
|
|
169
|
-
wsSendRaw(merged, { response: ctx.text })
|
|
168
|
+
wsSendRaw(merged, { response: ctx.text, message_tags: { source: 'channel' } })
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
171
|
return {
|
package/src/request/api.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const getStsToken = async (name: string, botToken: string, isPrivate: 1 |
|
|
|
7
7
|
// 确保 userToken 已缓存(如果未缓存会自动获取并缓存)
|
|
8
8
|
await getUserToken(botToken)
|
|
9
9
|
|
|
10
|
-
const response = await post<IStsTokenReq, IStsToken>('/user/
|
|
10
|
+
const response = await post<IStsTokenReq, IStsToken>('/user/getStsTokenByAsync', { sourceFileName: name, isPrivate }, { botToken })
|
|
11
11
|
|
|
12
12
|
if (!response || !response.data || !response.data.bucket) {
|
|
13
13
|
throw new Error('获取 OSS 临时凭证失败')
|
package/src/request/oss.ts
CHANGED
|
@@ -38,7 +38,9 @@ export const ossUpload = async (file: File | string | Buffer, botToken: string,
|
|
|
38
38
|
bucket: data.bucket,
|
|
39
39
|
endpoint: data.endPoint,
|
|
40
40
|
region: data.region,
|
|
41
|
-
secure: true
|
|
41
|
+
secure: true,
|
|
42
|
+
cname: true,
|
|
43
|
+
authorizationV4: true
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
const client = new OSS(options)
|
package/src/transport.ts
CHANGED
|
@@ -154,7 +154,8 @@ export function wsSendRaw(ctx: IMsgParams, content: Record<string, unknown>): bo
|
|
|
154
154
|
const ws = getWsConnection()
|
|
155
155
|
if (isWsOpen()) {
|
|
156
156
|
ws?.send(JSON.stringify(buildOpenclawBotChat(ctx, content, { mergeChannelDefaults: true })))
|
|
157
|
-
|
|
157
|
+
|
|
158
|
+
dcgLogger('已发送:' + JSON.stringify(buildOpenclawBotChat(ctx, content, { mergeChannelDefaults: true })))
|
|
158
159
|
}
|
|
159
160
|
return true
|
|
160
161
|
}
|