fixup configuration for irc-framework

main
Stef Dunlap 2023-03-13 16:57:02 -04:00
parent 2d3892ddc6
commit 8a59e82604
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
"server": "irc.libera.chat", "server": "irc.libera.chat",
"port": 6697, "port": 6697,
"nick": "chatgpt", "nick": "chatgpt",
"tsl": false, "tls": false,
"sasl": false, "sasl": false,
"username": "chatgpt", "username": "chatgpt",
"password": "", "password": "",

View File

@ -55,7 +55,7 @@ client.connect({
host: config.server, host: config.server,
nick: config.nick, nick: config.nick,
username: config.username, username: config.username,
tls: config.tsl, tls: config.tls,
port: config.port, port: config.port,
account: { account: {
account: config.username, account: config.username,
@ -82,10 +82,10 @@ client.on('message', async (event) => {
client.say(event.target, `(chat from ${event.nick} ignored, response in progress)`) client.say(event.target, `(chat from ${event.nick} ignored, response in progress)`)
return; return;
} }
let query = is_chat_cmd ? event.message.slice(chatCmd.length + 1) : event.message.slice(contCmd.length + 1);
if (is_chat_cmd && !config.alwaysRemember) { if (is_chat_cmd && !config.alwaysRemember) {
context.clear(); context.clear();
} }
const query = event.message.slice(chatCmd.length + 1);
context.add_user_prompt(query); context.add_user_prompt(query);
try { try {
await chatgpt(query, context.messages, handleChatGPTResponseLine); await chatgpt(query, context.messages, handleChatGPTResponseLine);