mirror of
https://github.com/danbulant/Shasha
synced 2026-06-07 16:43:02 +00:00
chat2
This commit is contained in:
parent
3493bc88a9
commit
6782fd30fa
2 changed files with 7 additions and 7 deletions
|
|
@ -18,12 +18,12 @@ module.exports = class chat extends commando.Command {
|
||||||
return trySend("Ask me somethin?");
|
return trySend("Ask me somethin?");
|
||||||
}
|
}
|
||||||
return msg.channel.startTyping()
|
return msg.channel.startTyping()
|
||||||
.then(
|
.then(
|
||||||
trySend(this.client, msg, await chatAnswer(
|
trySend(this.client, msg, await chatAnswer(
|
||||||
msg.cleanContent.slice((msg.guild.commandPrefix + msg.command.name).length + 1)
|
msg.cleanContent.slice((msg.guild.commandPrefix + msg.command.name).length + 1)
|
||||||
))).then(r => {
|
))).then(r => {
|
||||||
return r;
|
return r;
|
||||||
}).catch(() => {})
|
}).catch(() => { })
|
||||||
.finally(msg.channel.stopTyping());
|
.finally(msg.channel.stopTyping());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -24,7 +24,7 @@ const URL = [
|
||||||
async function chatAnswer(message) {
|
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);
|
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);
|
console.log(r.data);
|
||||||
return r.data.success;
|
return r.data.success;
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue