add typing indicators

This commit is contained in:
Ryan Voots 2020-08-28 21:12:47 -07:00
parent 7f5544c2d8
commit 97c0549add

3
bot.js
View file

@ -35,6 +35,8 @@ bot.on('message', msg => {
// console.log(perlbot_request, bot.user, foundme); // console.log(perlbot_request, bot.user, foundme);
} }
msg.channel.startTyping();
if (msg.channel.type == 'dm') { if (msg.channel.type == 'dm') {
perlbot_request.addressed = true; perlbot_request.addressed = true;
} }
@ -44,6 +46,7 @@ bot.on('message', msg => {
url: url, url: url,
data: perlbot_request data: perlbot_request
}).then(response => { }).then(response => {
msg.channel.stopTyping();
console.log(response.data); console.log(response.data);
if (response.data.body) { if (response.data.body) {
msg.reply(`${response.data.body}`); msg.reply(`${response.data.body}`);