Skip to content

Commit

Permalink
checkLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed Apr 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 456ed0b commit 79ba746
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ client.on("messageCreate", async message => {
try {
if (backendsocket.disconnected) message.channel.send(`🔕 Backend is not connected. Try again later.`);
message.channel.sendTyping();
enableLocal = await checkLocal();

// Conversation reset
if (message.content.startsWith("%reset")) {
@@ -160,6 +161,18 @@ client.on("messageCreate", async message => {
}
});

async function checkLocal() {
let response;
const sendchat = new Promise((resolve) => {
backendsocket.emit("localgenenabled", {}, (val) => {
response = val;
resolve();
});
});
await sendchat;
return response;
}

async function imageRecognition(message) {
if (message.attachments.size > 0 && !backendsocket.disconnected) {
let imageDetails = '';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spongegpt",
"version": "1.28.3",
"version": "1.28.4",
"description": "custom AI chatbot for discord",
"main": "index.js",
"type": "module",

0 comments on commit 79ba746

Please sign in to comment.