forked from embee/woomy
make the bot stop typing here as well
This commit is contained in:
parent
9be16b793e
commit
5d211fcc68
2 changed files with 13 additions and 14 deletions
|
@ -3,15 +3,15 @@ const request = require("request");
|
|||
exports.run = async (bot, message, args) => {
|
||||
message.channel.startTyping();
|
||||
try{
|
||||
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`);
|
||||
message.channel.startTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`);
|
||||
message.channel.startTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
};
|
||||
message.channel.stopTyping();
|
||||
};
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
|
|
|
@ -3,15 +3,14 @@ const request = require("request");
|
|||
exports.run = async (bot, message, args) => {
|
||||
message.channel.startTyping();
|
||||
try{
|
||||
request({ uri: "https://dog-api.kinduff.com/api/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.facts[0]}`);
|
||||
message.channel.stopTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
request({ uri: "https://dog-api.kinduff.com/api/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.facts[0]}`);
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
};
|
||||
message.channel.stopTyping();
|
||||
};
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
|
|
Loading…
Reference in a new issue