random and feed saving started
This commit is contained in:
@@ -13,8 +13,8 @@ module.exports = {
|
||||
var link = args[1];
|
||||
|
||||
libFlayer.addSource(title,link);
|
||||
message.reply(
|
||||
`Adding ${title} to the list of RSS sources`);
|
||||
message.reply(`Adding ${title} to the list of RSS sources`);
|
||||
libFlayer.writeFeed();
|
||||
libFlayer.loadFeeds();
|
||||
|
||||
},
|
||||
|
||||
@@ -7,11 +7,11 @@ module.exports = {
|
||||
message.reply(
|
||||
`!help - Lists the available commands
|
||||
**!search** - Searches the RSS Sources: *!search google*
|
||||
**!get**- Retrieves Search By Index: *!get 25*
|
||||
**!get** - Retrieves Search By Index: *!get 25*
|
||||
**!add** - Add a new RSS Source Feed dynamically: *!add http://www.engadget.com/rss.xml*
|
||||
**!update** - Updates all current RSS Feeds: *!update*
|
||||
**!quote** - Selects a random quote: *!update*
|
||||
**!exit** - Force kills bot: *!exit*
|
||||
**!quote** - Selects a random quote: *!quote*
|
||||
**!random** - Selects a random article: *!random*
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
16
commands/random.js
Normal file
16
commands/random.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
var libFlayer = require("../libFlayer.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'random',
|
||||
description: 'Random',
|
||||
async execute(message) {
|
||||
message.reply(
|
||||
`Selecting a random article...`
|
||||
);
|
||||
var i = Math.floor(Math.random() * (max - min + 1) + min );
|
||||
var feedArray = libFlayer.getFeeds();
|
||||
message.reply(`Retrieving: [Link](${feedArray[i].link})`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user