alerts added
This commit is contained in:
28
commands/alert.js
Normal file
28
commands/alert.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var libFlayer = require("../libFlayer.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'alert',
|
||||
description: 'Alert',
|
||||
async execute(message, args) {
|
||||
try {
|
||||
if (args.length < 1) {
|
||||
message.reply(`Please use in !alert [state]`);
|
||||
return;
|
||||
}
|
||||
var question = encodeURIComponent(args.join(" "));
|
||||
|
||||
var answerData = await libFlayer.weatherAlert(question);
|
||||
answerData.forEach(feature => {
|
||||
message.reply(`
|
||||
${feature.properties.areaDesc}
|
||||
${feature.properties.headline}
|
||||
${feature.properties.description}
|
||||
`);
|
||||
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
message.reply(err.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
`**!help** - *Lists the available commands*
|
||||
**!key** - Testing remote Airtable: *!key url*
|
||||
**!categories** - Displays Categories: *!categories*
|
||||
**!search** - Searches the RSS Sources: *!search google*
|
||||
**!find** - Searches the RSS Sources: *!find google*
|
||||
**!get** - Retrieves Search By Index: *!get 25*
|
||||
**!add** - Add a new RSS Source: *!add http://www.engadget.com/rss.xml*
|
||||
**!update** - Updates all current RSS Feeds: *!update*
|
||||
@@ -20,6 +20,7 @@ module.exports = {
|
||||
**!stock** - AlphaVantage Stock Search: *!stock IBM*
|
||||
**!play** - Plays a trivia game question: *!play*
|
||||
**!answer** - Answers for a question above: *!answer 1*
|
||||
**!alert** - Gets weather alerts for an area: *!alert TX*
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user