diff --git a/poe-client.js b/poe-client.js index 2f8798924..985ba16b9 100644 --- a/poe-client.js +++ b/poe-client.js @@ -521,7 +521,7 @@ class Client { console.log(`Sending message to ${chatbot}: ${message}`); - const messageData = await this.send_query("AddHumanMessageMutation", { + const messageData = await this.send_query("SendMessageMutation", { "bot": chatbot, "query": message, "chatId": this.bots[chatbot]["chatId"], @@ -531,14 +531,14 @@ class Client { delete this.active_messages["pending"]; - if (!messageData["data"]["messageCreateWithStatus"]["messageLimit"]["canSend"]) { + if (!messageData["data"]["messageEdgeCreate"]["message"]) { throw new Error(`Daily limit reached for ${chatbot}.`); } let humanMessageId; try { - const humanMessage = messageData["data"]["messageCreateWithStatus"]; - humanMessageId = humanMessage["message"]["messageId"]; + const humanMessage = messageData["data"]["messageEdgeCreate"]["message"]; + humanMessageId = humanMessage["node"]["messageId"]; } catch (error) { throw new Error(`An unknown error occured. Raw response data: ${messageData}`); } diff --git a/poe_graphql/SendMessageMutation.graphql b/poe_graphql/SendMessageMutation.graphql new file mode 100644 index 000000000..4b0a4383e --- /dev/null +++ b/poe_graphql/SendMessageMutation.graphql @@ -0,0 +1,40 @@ +mutation chatHelpers_sendMessageMutation_Mutation( + $chatId: BigInt! + $bot: String! + $query: String! + $source: MessageSource + $withChatBreak: Boolean! +) { + messageEdgeCreate(chatId: $chatId, bot: $bot, query: $query, source: $source, withChatBreak: $withChatBreak) { + chatBreak { + cursor + node { + id + messageId + text + author + suggestedReplies + creationTime + state + } + id + } + message { + cursor + node { + id + messageId + text + author + suggestedReplies + creationTime + state + chat { + shouldShowDisclaimer + id + } + } + id + } + } +} diff --git a/public/script.js b/public/script.js index b1c98b2fa..dab17418d 100644 --- a/public/script.js +++ b/public/script.js @@ -2743,7 +2743,7 @@ function saveReply(type, getMessage, this_mes_is_name, title) { } else { item['swipe_id'] = 0; item['swipes'] = []; - item['swipes'][0] = chat[chat.length - 1]['mes']; + item['swipes'][0] = chat[chat.length - 1]['mes']; } return { type, getMessage }; diff --git a/public/style.css b/public/style.css index 0d415f11d..c60b711dc 100644 --- a/public/style.css +++ b/public/style.css @@ -527,6 +527,7 @@ code { grid-column-start: 4; flex-flow: column; font-size: 30px; + cursor: pointer; } .swipe_right img, diff --git a/readme.md b/readme.md index 2a4b3ac3b..5b6a380fe 100644 --- a/readme.md +++ b/readme.md @@ -136,8 +136,8 @@ Easy to follow guide with pretty pictures: 5. Open a Command Prompt inside that folder by clicking in the 'Address Bar' at the top, typing `cmd`, and pressing Enter. 6. Once the black box (Command Prompt) pops up, type ONE of the following into it and press Enter: - * for Main Branch: `git clone -b main` - * for Dev Branch: `git clone -b dev` + * for Main Branch: `git clone https://github.com/Cohee1207/SillyTavern -b main` + * for Dev Branch: `git clone https://github.com/Cohee1207/SillyTavern -b dev` 7. Once everything is cloned, double click `Start.bat` to make NodeJS install its requirements. 8. The server will then start, and SillyTavern will popup in your browser. diff --git a/server.js b/server.js index 2308c2a16..f30b3714f 100644 --- a/server.js +++ b/server.js @@ -860,7 +860,7 @@ async function charaWrite(img_url, data, target_img, response = undefined, mes = let rawImg = await jimp.read(img_url); // Apply crop if defined - if (typeof crop == 'object') { + if (typeof crop == 'object' && [crop.x, crop.y, crop.width, crop.height].every(x => typeof x === 'number')) { rawImg = rawImg.crop(crop.x, crop.y, crop.width, crop.height); }