Open richteer opened 9 years ago
Nifty nifty. Although it may not be as easy to implement, it might be useful to have different levels of granularity of the respect. Like per-room instead of per-person. For example, a person can have a favorite food, and a room can have, say, a favorite person.
The original thought was focused on a particular context
, so might not be too hard? Maybe just have it bind to either a whole context
, or a subset of certain values... like, maybe a user's favorite food is dependent on which room they are in (example of room+user), etc.
This might rely on changing context to also include the author
field as well, which isn't a huge change, just semantic.
Modules that automatically handle and keep separate local data for certain contexts. This means that code only needs to be written once, and automagically switches contexts when messages from difference sources are received.
This should be seamless to the module developer. That way, they can store specific information about a particular user, chat rooms, etc. and be accessed seamlessly without the module developer ever needing to implement some kind of context manager. Thus, it should be assumed that messages received from different sources (different agents, chat rooms, etc.) are independent of one another, and thus unaware of each other.
Consider the following sample ContextModule, FavoriteFood.
(Note: this is an example of #3 being useful to resolve)
Now, if users Alice and Bob were to both send
!set <food>
, with different values for<food>
, sending!food
should cause the bot to respond with two different messages, despite the same local variable name being used.