3.2.0-b2
Fix some issues with 3.2 upgrades
This commit is contained in:
parent
553344a416
commit
30ed030b62
|
@ -1,4 +1,6 @@
|
|||
# Changelog
|
||||
### Fixed
|
||||
- Fixed upgrader script not including channel ID in new database
|
||||
|
||||
## v3.2.0-b1
|
||||
### Updated
|
||||
|
|
|
@ -16,6 +16,7 @@ module.exports = function () {
|
|||
feedID: feed.id,
|
||||
url: feed.url,
|
||||
roleID: feed.roleID,
|
||||
channelID: feed.channelID,
|
||||
cachedLinks: feed.cachedLinks,
|
||||
maxCacheSize: feed.maxCacheSize
|
||||
}));
|
||||
|
@ -24,5 +25,5 @@ module.exports = function () {
|
|||
guildData.save();
|
||||
}
|
||||
|
||||
FileSystem.unlinkSync("./guilds.json");
|
||||
FileSystem.rename("./guilds.json", "./guilds.json.backup");
|
||||
};
|
|
@ -64,21 +64,25 @@ module.exports = class FeedData extends Camo.EmbeddedDocument {
|
|||
}
|
||||
|
||||
_doFetchRSS(guild) {
|
||||
FeedReadPromise(this.url + "asdf")
|
||||
const that = this;
|
||||
FeedReadPromise(this.url)
|
||||
.then(articles => {
|
||||
if (articles.length > 0 && articles[0].link) {
|
||||
const latest = normaliseUrl(articles[0].link);
|
||||
|
||||
if (!this.cachedLinks.includes(latest)) {
|
||||
const channel = guild.channels.get(this.channelID),
|
||||
role = guild.roles.get(this.roleID);
|
||||
if (!that.cachedLinks.includes(latest)) {
|
||||
that.cache(latest);
|
||||
|
||||
const channel = guild.channels.get(that.channelID),
|
||||
role = guild.roles.get(that.roleID);
|
||||
|
||||
channel.send((role || "") + formatPost(articles[0]))
|
||||
.catch(err => DiscordUtil.dateDebugError(`Error posting in ${channel.id}: ${err.message || err}`));
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => DiscordUtil.dateDebugError(`Error reading feed ${this.url}`, err));
|
||||
.catch(err =>
|
||||
DiscordUtil.dateDebugError(`Error reading feed ${that.url}`, err));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@ function handleGuildMessage(client, message, commands) {
|
|||
function handleGuildCommand(client, message, commands, guildData) {
|
||||
const { botName, isMemberAdmin, params, command } = parseDetails(message, commands);
|
||||
|
||||
if (!command)
|
||||
return;
|
||||
|
||||
if (params.length < command.expectedParamCount)
|
||||
message.reply(`Incorrect syntax!\n**Expected:** *${botName} ${command.syntax}*\n**Need help?** *${botName} help*`);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "3.2.0-b1",
|
||||
"version": "3.2.0-b2",
|
||||
"main": "app/index.js",
|
||||
"scripts": {
|
||||
"postinstall": "cd ./discord-bot-core && npm install",
|
||||
|
|
Loading…
Reference in a new issue