File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11package common
22
3- var Version = "v4.5.9 " // this hard coding will be replaced automatically when building, no need to manually change
3+ var Version = "v4.5.10 " // this hard coding will be replaced automatically when building, no need to manually change
44
55const (
66 RequestIdKey = "X-Request-Id"
Original file line number Diff line number Diff line change @@ -38,6 +38,17 @@ func processMessageUpdateForOpenAI(m *discordgo.MessageUpdate) model.OpenAIChatC
3838 }
3939 }
4040
41+ if len (m .Attachments ) != 0 {
42+ for _ , attachment := range m .Attachments {
43+ if attachment .ProxyURL != "" && ! strings .Contains (m .Content , attachment .ProxyURL ) {
44+ if m .Content != "" {
45+ m .Content += "\n "
46+ }
47+ m .Content += fmt .Sprintf ("%s\n " , attachment .ProxyURL , attachment .ProxyURL )
48+ }
49+ }
50+ }
51+
4152 promptTokens := common .CountTokens (m .ReferencedMessage .Content )
4253 completionTokens := common .CountTokens (m .Content )
4354
@@ -158,6 +169,17 @@ func processMessageCreateForOpenAI(m *discordgo.MessageCreate) model.OpenAIChatC
158169 }
159170 }
160171
172+ if len (m .Attachments ) != 0 {
173+ for _ , attachment := range m .Attachments {
174+ if attachment .ProxyURL != "" && ! strings .Contains (m .Content , attachment .ProxyURL ) {
175+ if m .Content != "" {
176+ m .Content += "\n "
177+ }
178+ m .Content += fmt .Sprintf ("%s\n " , attachment .ProxyURL , attachment .ProxyURL )
179+ }
180+ }
181+ }
182+
161183 promptTokens := common .CountTokens (m .ReferencedMessage .Content )
162184 completionTokens := common .CountTokens (m .Content )
163185
You can’t perform that action at this time.
0 commit comments