Add onReady function in bot.js
This commit is contained in:
parent
939e6f5946
commit
d22c9b91dc
|
@ -1,6 +1,13 @@
|
|||
const GuildData = require("./models/guild-data.js");
|
||||
|
||||
module.exports = {
|
||||
onReady(client, guildsData, config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
parseLinksInGuilds(client.guilds, guildsData)
|
||||
.then(() => checkFeedsInGuilds(client.guilds, guildsData))
|
||||
.then(() => setInterval(() => checkFeedsInGuilds(client.guilds, guildsData), config.feedCheckIntervalSec * 1000)); //set up an interval to check all the feeds
|
||||
});
|
||||
},
|
||||
onCommand(commandObj, commandsObj, params, guildData, message) {
|
||||
switch (commandObj.command) {
|
||||
case commandsObj.addFeed.command:
|
||||
|
|
|
@ -38,6 +38,8 @@ module.exports = (client, config = null) => {
|
|||
HandleMessage.text(client, config, message, guildsData);
|
||||
}
|
||||
});
|
||||
|
||||
Bot.onReady(client, guildsData, config).then(() => writeFile).catch(err => DiscordUtil.dateError(err));
|
||||
};
|
||||
|
||||
const HandleMessage = {
|
||||
|
|
Loading…
Reference in a new issue