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