add typing indicators
This commit is contained in:
parent
7f5544c2d8
commit
97c0549add
1 changed files with 3 additions and 0 deletions
3
bot.js
3
bot.js
|
@ -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}`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue