This commit is contained in:
Neko Life 2021-06-28 13:48:59 +09:00
parent 3493bc88a9
commit 6782fd30fa
2 changed files with 7 additions and 7 deletions

View file

@ -18,12 +18,12 @@ module.exports = class chat extends commando.Command {
return trySend("Ask me somethin?");
}
return msg.channel.startTyping()
.then(
trySend(this.client, msg, await chatAnswer(
msg.cleanContent.slice((msg.guild.commandPrefix + msg.command.name).length + 1)
.then(
trySend(this.client, msg, await chatAnswer(
msg.cleanContent.slice((msg.guild.commandPrefix + msg.command.name).length + 1)
))).then(r => {
return r;
}).catch(() => {})
.finally(msg.channel.stopTyping());
return r;
}).catch(() => { })
.finally(msg.channel.stopTyping());
}
};

View file

@ -24,7 +24,7 @@ const URL = [
async function chatAnswer(message) {
// 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 => {
return axios.get(`https://api.simsimi.net/v1/?text=${message.replace(/( |\n|\t)+/, "+").slice(0, 1000).replace(/Sim doesn't know what you are talking about. Please teach me/, "Sorry but i don't speak gibberish")}&lang=en`).then(r => {
console.log(r.data);
return r.data.success;
}).catch(() => { });