moving to airtable design

This commit is contained in:
John Facey
2021-12-24 01:20:45 -06:00
parent f8ff15a018
commit e85d5644d4
6 changed files with 168 additions and 33 deletions

View File

@@ -5,17 +5,23 @@ module.exports = {
description: 'Add RSS Source',
execute(message,args) {
if (args.length < 2) {
message.reply(`Please use in !add [title] [https://domain.com/feed.xml] format`);
if (args.length < 3) {
message.reply(`Please use in !add [title] [https://domain.com/feed.xml] [category] format`);
return;
}
var title = args[0];
var link = args[1];
var category = args[2];
libFlayer.addSource(title,link);
message.reply(`Adding ${title} to the list of RSS sources`);
var sources = libFlayer.getSources();
libFlayer.writeFeed(sources);
var result = libFlayer.addSource(title,link,category);
if (result) {
message.reply(`Adding ${title} to the list of RSS sources`);
} else {
message.reply(`${title} already exists in the list of RSS sources`);
}
var sources = libFlayer.getSources();
//libFlayer.getConfig();
libFlayer.loadFeeds();
}