Improved function to work with updated storage

This commit is contained in:
Logan Cusano
2023-02-25 14:49:03 -05:00
parent 12b4a566c7
commit c8cf6e35f7

View File

@@ -30,20 +30,19 @@ module.exports = {
if (!category) category = "ALL";
libCore.addSource(title, link, category, interaction.guildId, interaction.channelId, (err, result) => {
console.log("Result from adding entry", result);
await libCore.addSource(title, link, category, interaction.guildId, interaction.channelId, (err, result) => {
log.DEBUG("Result from adding entry", result);
if (result) {
interaction.reply(`Adding ${title} to the list of RSS sources`);
} else {
interaction.reply(`${title} already exists in the list of RSS sources`);
}
libCore.loadFeeds();
});
}catch(err){
log.ERROR(err)
await message.reply(err.toString());
await interaction.reply(err.toString());
}
libCore.loadFeeds();
}
};