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
f901507d
Commit
f901507d
authored
Feb 11, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update chatgpt cond
parent
219e4297
Pipeline
#20140
passed with stages
in 9 minutes and 52 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
ygopro-server.coffee
ygopro-server.coffee
+1
-1
ygopro-server.js
ygopro-server.js
+1
-3
No files found.
ygopro-server.coffee
View file @
f901507d
...
...
@@ -3462,7 +3462,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
client
.
abuse_count
=
client
.
abuse_count
+
2
if
client
.
abuse_count
ygopro
.
stoc_send_chat
(
client
,
"${chat_warn_level0}"
,
ygopro
.
constants
.
COLORS
.
RED
)
cancel
=
true
if
not
cancel
and
settings
.
modules
.
chatgpt
.
enabled
and
room
.
windbot
and
not
client
.
is_post_watcher
and
client
.
pos
==
0
#
< 2 and not client.is_local
if
not
cancel
and
settings
.
modules
.
chatgpt
.
enabled
and
room
.
windbot
and
not
client
.
is_post_watcher
and
client
.
pos
<
2
and
not
client
.
is_local
session_key
=
"
#{
settings
.
modules
.
chatgpt
.
session
}
:
#{
settings
.
port
}
:
#{
CLIENT_get_authorize_key
(
client
)
}
"
axios
.
post
(
"
#{
settings
.
modules
.
chatgpt
.
endpoint
}
/api/chat"
,
{
session
:
session_key
,
...
...
ygopro-server.js
View file @
f901507d
...
...
@@ -4640,9 +4640,8 @@
ygopro
.
stoc_send_chat
(
client
,
"
${chat_warn_level0}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
cancel
=
true
;
}
if
(
!
cancel
&&
settings
.
modules
.
chatgpt
.
enabled
&&
room
.
windbot
&&
!
client
.
is_post_watcher
&&
client
.
pos
===
0
)
{
//< 2 and not client.is_local
if
(
!
cancel
&&
settings
.
modules
.
chatgpt
.
enabled
&&
room
.
windbot
&&
!
client
.
is_post_watcher
&&
client
.
pos
<
2
&&
!
client
.
is_local
)
{
session_key
=
`
${
settings
.
modules
.
chatgpt
.
session
}
:
${
settings
.
port
}
:
${
CLIENT_get_authorize_key
(
client
)}
`
;
log
.
info
(
"
chatgpt
"
,
session_key
,
msg
);
axios
.
post
(
`
${
settings
.
modules
.
chatgpt
.
endpoint
}
/api/chat`
,
{
session
:
session_key
,
text
:
msg
...
...
@@ -4653,7 +4652,6 @@
}
}).
then
(
function
(
res
)
{
var
chunk
,
chunks
,
j
,
len
,
line
,
lines
,
results
,
text
;
log
.
info
(
"
chatgpt result
"
,
res
.
data
.
text
);
text
=
res
.
data
.
data
.
text
;
lines
=
text
.
split
(
"
\n
"
);
results
=
[];
...
...
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