chat and errLoop

This commit is contained in:
Neko Life 2021-06-28 13:21:31 +09:00
parent 05dce309d1
commit 3493bc88a9
2 changed files with 7 additions and 2 deletions

View file

@ -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) {

View file

@ -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 }