Skip to content

Commit

Permalink
fix(Conf): 🐛 Add missing database parameter upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefouch committed Sep 7, 2022
1 parent 1882aa0 commit d4046ea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
<br/>The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
<br/>and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.2.1] - 2022-09-07

### Fixed

- Command `/conf` not working in some cases.

## [6.2.0] - 2022-09-07

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sebedius-yearzero-discord-bot",
"version": "6.2.0",
"version": "6.2.1",
"description": "A bot companion for running Year Zero roleplaying games over Discord.",
"author": "Stefouch",
"license": "GPL-3.0-or-later",
Expand Down Expand Up @@ -103,4 +103,4 @@
"sinon": "^14.0.0",
"standard-version": "^9.5.0"
}
}
}
4 changes: 2 additions & 2 deletions src/commands/admin/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ module.exports = class ConfCommand extends SebediusCommand {
guildDocument = await this.bot.database.guilds.findByIdAndUpdate(
interaction.guildId,
updateData,
{ projection: 'game locale', lean: true, new: true },
{ projection: 'game locale', upsert: true, lean: true, new: true },
);
Logger.client(`📝 Database | update: Guild ${interaction.guildId} with ${JSON.stringify(updateData)}`);
}
else {
guildDocument = await this.bot.database.guilds.findById(
interaction.guildId,
'game locale',
{ lean: true },
{ upsert: true, lean: true },
);
}

Expand Down

0 comments on commit d4046ea

Please sign in to comment.