diff --git a/resources/functions.js b/resources/functions.js index 2d77148..d68ad5c 100644 --- a/resources/functions.js +++ b/resources/functions.js @@ -21,7 +21,7 @@ async function errLog(theError, msg, client, sendTheError, errorMessage, notify) if (!(theError instanceof Error) || !client) return console.error("[ERRLOG] Not error instance or no required param:", theError); let [ret, logThis, inLogChannel, sendErr] = [undefined, '', '', '']; if (msg instanceof Message) { - client.emit("commandError", msg.command, theError, msg); + // client.emit("commandError", msg.command, theError, msg); logThis = `\`${msg.command?.name}\` (${msg.id}) ${msg.url} in ${msg.guild ? `**${msg.channel.name}** (${msg.channel.id}) of **${msg.guild.name}** (${msg.guild.id})` : `**DM**`} ran by **${msg.author.tag}** (${msg.author.id}) \n\n`; if (errorMessage) { if (errorMessage.length > 0) { diff --git a/resources/shaChat.js b/resources/shaChat.js index 5bd805d..f45b4b2 100644 --- a/resources/shaChat.js +++ b/resources/shaChat.js @@ -22,7 +22,12 @@ const URL = [ */ async function chatAnswer(message) { - return axios.post("https://rebot.me/ask", { username: "simsimi", question: message }).then(r => r.data).catch(() => { }); + // return axios.post("https://rebot.me/ask", { username: "simsimi", question: message }).then(r => r.data).catch(() => { }); + console.log(message); + return axios.get(`https://api.simsimi.net/v1/?text=${message.replace(/( |\n|\t)+/, "+")}&lang=en&key=API-TEST-WEB`).then(r => { + console.log(r.data); + return r.data.success; + }).catch(() => { }); } module.exports = { chatAnswer }