mirror of
https://github.com/danbulant/Shasha
synced 2026-05-24 12:22:00 +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 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());
|
||||
}
|
||||
};
|
||||
|
|
@ -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(() => { });
|
||||
|
|
|
|||
Loading…
Reference in a new issue