Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
srvpro
Commits
ee2586b5
Commit
ee2586b5
authored
Feb 05, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix chatgpt pos reply
parent
cf0ef0a7
Pipeline
#42862
passed with stages
in 8 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
ygopro-server.coffee
ygopro-server.coffee
+4
-2
ygopro-server.js
ygopro-server.js
+5
-3
No files found.
ygopro-server.coffee
View file @
ee2586b5
...
@@ -3768,13 +3768,15 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
...
@@ -3768,13 +3768,15 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
}).
then
((
res
)
->
}).
then
((
res
)
->
text
=
res
.
data
.
choices
[
0
].
message
.
content
text
=
res
.
data
.
choices
[
0
].
message
.
content
lines
=
text
.
split
(
"
\n
"
)
lines
=
text
.
split
(
"
\n
"
)
# 计算消息type: 如果决斗中且玩家后攻,用client.pos;否则用1-client.pos
chat_type
=
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
DUELING
and
!
client
.
is_first
then
client
.
pos
else
1
-
client
.
pos
for
line
in
lines
for
line
in
lines
if
line
if
line
chunks
=
_
.
chunk
(
line
,
100
)
chunks
=
_
.
chunk
(
line
,
100
)
for
chunk
in
chunks
for
chunk
in
chunks
ygopro
.
stoc_send_chat_to_room
(
room
,
chunk
.
join
(
''
),
1
-
client
.
pos
)
ygopro
.
stoc_send_chat_to_room
(
room
,
chunk
.
join
(
''
),
chat_type
)
else
else
ygopro
.
stoc_send_chat_to_room
(
room
,
' '
,
1
-
client
.
pos
)
ygopro
.
stoc_send_chat_to_room
(
room
,
' '
,
chat_type
)
# save text
# save text
if
shrink_count
>
0
if
shrink_count
>
0
room
.
chatgpt_conversation
.
splice
(
0
,
shrink_count
)
room
.
chatgpt_conversation
.
splice
(
0
,
shrink_count
)
...
...
ygopro-server.js
View file @
ee2586b5
...
@@ -5024,19 +5024,21 @@
...
@@ -5024,19 +5024,21 @@
Authorization
:
`Bearer
${
settings
.
modules
.
chatgpt
.
token
}
`
Authorization
:
`Bearer
${
settings
.
modules
.
chatgpt
.
token
}
`
}
}
}).
then
(
function
(
res
)
{
}).
then
(
function
(
res
)
{
var
chunk
,
chunks
,
l
,
len1
,
len2
,
line
,
lines
,
m
,
text
;
var
ch
at_type
,
ch
unk
,
chunks
,
l
,
len1
,
len2
,
line
,
lines
,
m
,
text
;
text
=
res
.
data
.
choices
[
0
].
message
.
content
;
text
=
res
.
data
.
choices
[
0
].
message
.
content
;
lines
=
text
.
split
(
"
\n
"
);
lines
=
text
.
split
(
"
\n
"
);
// 计算消息type: 如果决斗中且玩家后攻,用client.pos;否则用1-client.pos
chat_type
=
room
.
duel_stage
===
ygopro
.
constants
.
DUEL_STAGE
.
DUELING
&&
!
client
.
is_first
?
client
.
pos
:
1
-
client
.
pos
;
for
(
l
=
0
,
len1
=
lines
.
length
;
l
<
len1
;
l
++
)
{
for
(
l
=
0
,
len1
=
lines
.
length
;
l
<
len1
;
l
++
)
{
line
=
lines
[
l
];
line
=
lines
[
l
];
if
(
line
)
{
if
(
line
)
{
chunks
=
_
.
chunk
(
line
,
100
);
chunks
=
_
.
chunk
(
line
,
100
);
for
(
m
=
0
,
len2
=
chunks
.
length
;
m
<
len2
;
m
++
)
{
for
(
m
=
0
,
len2
=
chunks
.
length
;
m
<
len2
;
m
++
)
{
chunk
=
chunks
[
m
];
chunk
=
chunks
[
m
];
ygopro
.
stoc_send_chat_to_room
(
room
,
chunk
.
join
(
''
),
1
-
client
.
pos
);
ygopro
.
stoc_send_chat_to_room
(
room
,
chunk
.
join
(
''
),
chat_type
);
}
}
}
else
{
}
else
{
ygopro
.
stoc_send_chat_to_room
(
room
,
'
'
,
1
-
client
.
pos
);
ygopro
.
stoc_send_chat_to_room
(
room
,
'
'
,
chat_type
);
}
}
}
}
// save text
// save text
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment