Delete loading message after message has been sent
This commit is contained in:
parent
4f3270c9d5
commit
c754195abb
1 changed files with 8 additions and 4 deletions
|
@ -30,22 +30,26 @@ class CleverBotCommand extends Command {
|
||||||
let loadingmsg = await message.channel.send('Processing! <a:loadingmin:527579785212329984>');
|
let loadingmsg = await message.channel.send('Processing! <a:loadingmin:527579785212329984>');
|
||||||
if (!conversation[message.guild.id]) conversation[message.guild.id] = [];
|
if (!conversation[message.guild.id]) conversation[message.guild.id] = [];
|
||||||
|
|
||||||
|
|
||||||
if (!conversation[0]) {
|
if (!conversation[0]) {
|
||||||
cleverbot(args.message).then(response => {
|
cleverbot(args.message).then(response => {
|
||||||
conversation[message.guild.id].push(args.message);
|
conversation[message.guild.id].push(args.message);
|
||||||
conversation[message.guild.id].push(response);
|
conversation[message.guild.id].push(response);
|
||||||
return message.channel.send(response);
|
return message.channel.send(response)
|
||||||
|
.then(() => {
|
||||||
|
loadingmsg.delete();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
cleverbot(args.message, conversation[message.guild.id]).then(response => {
|
cleverbot(args.message, conversation[message.guild.id]).then(response => {
|
||||||
conversation[message.guild.id].push(args.message);
|
conversation[message.guild.id].push(args.message);
|
||||||
conversation[message.guild.id].push(response);
|
conversation[message.guild.id].push(response);
|
||||||
return message.channel.send(response);
|
return message.channel.send(response)
|
||||||
|
.then(() => {
|
||||||
|
loadingmsg.delete();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(conversation);
|
console.log(conversation);
|
||||||
loadingmsg.delete();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = CleverBotCommand;
|
module.exports = CleverBotCommand;
|
Loading…
Reference in a new issue