feat(bn): migrate battle notifier to DB #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Battle Notifier migration discussion here.
What changes are proposed in this pull request?
Migrate current battle notifier user settings store with file system at
bn.store.json
file, to use the database instead.bnStore.js
manages user settings storage. Update to call to the server API instead to get and post user settings from the server.apisauce
.bnModelUtils.js
is a new file to handle data between API and bot code, to parse incoming notification settings from server model to bot model and viceversa.api/bn/:DiscordId
- get user settingsapi/bn/:DiscordId
- set user notification rulesapi/bn
- gets all "active" settings withBnEnabled
and at least oneBnKuskiRule
api/bn/:DiscordId/toggle/:BnEnabled
- turn notifications on/offapi/bn/:DiscordId/linked
- is there an elma online user connected withDiscordId
jest
tovitest
and updated for the new logic.!bn
bot remains the same, commands are unchanged. Added one new message for the first interaction with the bot. If you have not connected elma online user with your discord id you will now see the following intructions: