Bug fix so message updates will create guild entry
This commit is contained in:
parent
f7230ec0fb
commit
3c01d37bd5
@ -134,18 +134,28 @@ module.exports = {
|
|||||||
return queryParts.join('');
|
return queryParts.join('');
|
||||||
break;
|
break;
|
||||||
case "setTreeMessage":
|
case "setTreeMessage":
|
||||||
|
// queryParts = [
|
||||||
|
// `UPDATE guild_info SET tree_message_id = ${db.escape(this.treeMessageId)}, `,
|
||||||
|
// `tree_channel_id = ${db.escape(this.treeChannelId)} `,
|
||||||
|
// `WHERE guild_id = ${db.escape(this.guildId)}`
|
||||||
|
// ];
|
||||||
queryParts = [
|
queryParts = [
|
||||||
`UPDATE guild_info SET tree_message_id = ${db.escape(this.treeMessageId)}, `,
|
`INSERT INTO guild_info (guild_id, tree_message_id, tree_channel_id)`,
|
||||||
`tree_channel_id = ${db.escape(this.treeChannelId)} `,
|
`VALUES (${db.escape(this.guildId)}, ${db.escape(this.treeMessageId)}, ${db.escape(this.treeChannelId)})`,
|
||||||
`WHERE guild_id = ${db.escape(this.guildId)}`
|
`ON DUPLICATE KEY UPDATE tree_message_id = ${db.escape(this.treeMessageId)}, tree_channel_id = ${db.escape(this.treeChannelId)}`
|
||||||
];
|
];
|
||||||
return queryParts.join('');
|
return queryParts.join('');
|
||||||
break;
|
break;
|
||||||
case "setLeaderboardMessage":
|
case "setLeaderboardMessage":
|
||||||
|
// queryParts = [
|
||||||
|
// `UPDATE guild_info SET leaderboard_message_id = ${db.escape(this.leaderboardMessageId)}, `,
|
||||||
|
// `leaderboard_channel_id = ${db.escape(this.leaderboardChannelId)} `,
|
||||||
|
// `WHERE guild_id = ${db.escape(this.guildId)}`
|
||||||
|
// ];
|
||||||
queryParts = [
|
queryParts = [
|
||||||
`UPDATE guild_info SET leaderboard_message_id = ${db.escape(this.leaderboardMessageId)}, `,
|
`INSERT INTO guild_info (guild_id, leaderboard_message_id, leaderboard_channel_id)`,
|
||||||
`leaderboard_channel_id = ${db.escape(this.leaderboardChannelId)} `,
|
`VALUES (${db.escape(this.guildId)}, ${db.escape(this.leaderboardMessageId)}, ${db.escape(this.leaderboardChannelId)})`,
|
||||||
`WHERE guild_id = ${db.escape(this.guildId)}`
|
`ON DUPLICATE KEY UPDATE leaderboard_message_id = ${db.escape(this.leaderboardMessageId)}, leaderboard_channel_id = ${db.escape(this.leaderboardChannelId)}`
|
||||||
];
|
];
|
||||||
return queryParts.join('');
|
return queryParts.join('');
|
||||||
break;
|
break;
|
||||||
|
@ -686,6 +686,7 @@ const functions = {
|
|||||||
if (doDbUpdate) {
|
if (doDbUpdate) {
|
||||||
const query = guildInfo.queryBuilder("setLeaderboardMessage");
|
const query = guildInfo.queryBuilder("setLeaderboardMessage");
|
||||||
await dbfn.setGuildInfo(query);
|
await dbfn.setGuildInfo(query);
|
||||||
|
await functions.collectionBuilders.guildInfos(message.client);
|
||||||
}
|
}
|
||||||
await dbfn.uploadLeaderboard(isLeaderboard);
|
await dbfn.uploadLeaderboard(isLeaderboard);
|
||||||
// Update the comparison message
|
// Update the comparison message
|
||||||
@ -741,6 +742,7 @@ const functions = {
|
|||||||
if (doDbUpdate) {
|
if (doDbUpdate) {
|
||||||
const query = guildInfo.queryBuilder("setTreeInfo");
|
const query = guildInfo.queryBuilder("setTreeInfo");
|
||||||
await dbfn.setGuildInfo(query);
|
await dbfn.setGuildInfo(query);
|
||||||
|
await functions.collectionBuilders.guildInfos(message.client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user