mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 优化slack对话拉取机制,避免过长对话导致的maxContentLength size of -1 exceeded错误
This commit is contained in:
parent
30aa32d5e9
commit
bb90c3c3e7
1 changed files with 5 additions and 2 deletions
|
|
@ -115,13 +115,14 @@ export class SlackClaudeClient {
|
|||
}
|
||||
return response
|
||||
} else {
|
||||
await this.app.client.chat.postMessage({
|
||||
let postResponse = await this.app.client.chat.postMessage({
|
||||
as_user: true,
|
||||
text: `<@${Config.slackClaudeUserId}> ${prompt}`,
|
||||
token: this.config.slackUserToken,
|
||||
channel: channel.id,
|
||||
thread_ts: conversationId
|
||||
})
|
||||
let postTs = postResponse.ts
|
||||
let response = '_Typing…_'
|
||||
let tryTimes = 0
|
||||
// 发完先等3喵
|
||||
|
|
@ -131,8 +132,10 @@ export class SlackClaudeClient {
|
|||
token: this.config.slackUserToken,
|
||||
channel: channel.id,
|
||||
limit: 1000,
|
||||
ts: conversationId
|
||||
ts: conversationId,
|
||||
oldest: postTs
|
||||
})
|
||||
|
||||
if (replies.messages.length > 0) {
|
||||
let formalMessages = replies.messages
|
||||
.filter(m => m.metadata?.event_type !== 'claude_moderation')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue