discord-bot-rss-feed/app/models/guild-data.js

23 lines
492 B
JavaScript
Raw Normal View History

const FeedData = require("./feed-data.js");
const Util = require("discordjs-util");
2017-07-27 09:50:44 +03:00
2017-07-27 01:53:01 +03:00
module.exports = class GuildData {
constructor({ id, feeds }) {
2017-07-27 01:53:01 +03:00
this.id = id;
this.feeds = feeds.filter(feed => new FeedData(feed));
}
cachePastPostedLinks() {
const promises = [];
this.feeds.forEach(feed => {
promises.push(feed.cachePastPostedLinks(this).catch(Util.dateError));
});
return Promise.all(promises);
2017-07-27 01:53:01 +03:00
}
checkFeeds() {
2017-08-13 05:12:20 +03:00
// this.feeds.forEach(feed => feed.check());
}
2017-07-27 01:53:01 +03:00
};