Skip to content

Commit d4046ea

Browse files
committed
fix(Conf): 🐛 Add missing database parameter upsert
1 parent 1882aa0 commit d4046ea

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
<br/>The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
<br/>and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [6.2.1] - 2022-09-07
8+
9+
### Fixed
10+
11+
- Command `/conf` not working in some cases.
12+
713
## [6.2.0] - 2022-09-07
814

915
### Added

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sebedius-yearzero-discord-bot",
3-
"version": "6.2.0",
3+
"version": "6.2.1",
44
"description": "A bot companion for running Year Zero roleplaying games over Discord.",
55
"author": "Stefouch",
66
"license": "GPL-3.0-or-later",
@@ -103,4 +103,4 @@
103103
"sinon": "^14.0.0",
104104
"standard-version": "^9.5.0"
105105
}
106-
}
106+
}

src/commands/admin/conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ module.exports = class ConfCommand extends SebediusCommand {
4646
guildDocument = await this.bot.database.guilds.findByIdAndUpdate(
4747
interaction.guildId,
4848
updateData,
49-
{ projection: 'game locale', lean: true, new: true },
49+
{ projection: 'game locale', upsert: true, lean: true, new: true },
5050
);
5151
Logger.client(`📝 Database | update: Guild ${interaction.guildId} with ${JSON.stringify(updateData)}`);
5252
}
5353
else {
5454
guildDocument = await this.bot.database.guilds.findById(
5555
interaction.guildId,
5656
'game locale',
57-
{ lean: true },
57+
{ upsert: true, lean: true },
5858
);
5959
}
6060

0 commit comments

Comments
 (0)