Update 'Feature: Room State Management'

projectmoon 2020-11-29 21:37:01 +00:00
parent 832ec8cb44
commit 93aec5ed34
1 changed files with 9 additions and 1 deletions

@ -65,6 +65,14 @@ Need to utilize `on_room_member` event for this:
* When the bot joins a room for the first time, in addition to recording all users, it should also record information about the room itself. * When the bot joins a room for the first time, in addition to recording all users, it should also record information about the room itself.
### Architecture Changes
Implementation of a new resync command, and common code used by both the room member changed event and execution of this command.
## Implementation ## Implementation
Most functionality is in a new database object `Rooms`. Keep track of users and the rooms they are in, both by username to a list of room IDs, and a room ID to list of usernames. It will also keep track of actual room information and other useful stuff. Most functionality is in a new database object `Rooms`. It contains all functions for storing information about rooms and users.
The code is being reorganized to support a new command called resync.
A new "business logic" layer needs to be created that can do things like update room info. This is because it might be called from a command, event handler, or even bot startup.