Room event callbacks
mirukana opened this issue · 0 comments
mirukana commented
-
Rooms.callbacks
field of typeDict[Type[Event[ContentT]], Set[Callable[[Room, Event], None]]]
, users can manually add or remove callbacks with e.g.client.rooms.callbacks[TimelineEvent[Text]].add(my_func)
.
The type keys can be anEvent
type,Content
type, orEvent[Content]
. -
Callback groups: a class for which every user-defined, non-underscore-prefixed method will automatically be registered as a callback.
Methods would have signatures such as:async def any_name(self, room: Room, event: Timeline[Text]) -> None: ...
.
The event parameter's type should be introspected usinginspect.signature(func)
.