mirror of
https://github.com/danbulant/Shasha
synced 2026-06-09 09:30:47 +00:00
epic
This commit is contained in:
parent
204442b126
commit
13f8a4d43a
2 changed files with 15 additions and 18 deletions
|
|
@ -15,15 +15,14 @@ module.exports = class chat extends commando.Command {
|
||||||
}
|
}
|
||||||
async run(msg, args) {
|
async run(msg, args) {
|
||||||
if (!args) {
|
if (!args) {
|
||||||
return trySend("Ask me somethin?");
|
return trySend(msg.client, msg, "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).trim()
|
||||||
))).then(r => {
|
)).then(r => r)
|
||||||
return r;
|
).catch(() => { })
|
||||||
}).catch(() => { })
|
|
||||||
.finally(msg.channel.stopTyping());
|
.finally(msg.channel.stopTyping());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -23,10 +23,8 @@ function giveNickHeart(msg) {
|
||||||
|
|
||||||
async function letsChat(msg) {
|
async function letsChat(msg) {
|
||||||
if (msg.channel.id === configFile.chatChannel && !msg.author.bot && !msg.isCommand && msg.cleanContent.length > 0) {
|
if (msg.channel.id === configFile.chatChannel && !msg.author.bot && !msg.isCommand && msg.cleanContent.length > 0) {
|
||||||
return msg.channel.startTyping().then(trySend(msg.client, msg, await chatAnswer(msg.cleanContent))
|
return msg.channel.startTyping().then(trySend(msg.client, msg, await chatAnswer(msg.cleanContent)).then(r => r)
|
||||||
).then(r => {
|
).catch(() => { })
|
||||||
return r;
|
|
||||||
}).catch(() => {})
|
|
||||||
.finally(msg.channel.stopTyping());
|
.finally(msg.channel.stopTyping());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue