Commit f901507d authored by nanahira's avatar nanahira

update chatgpt cond

parent 219e4297
Pipeline #20140 passed with stages
in 9 minutes and 52 seconds
......@@ -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,
......
......@@ -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 = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment