on_event
Method
This is a method of the GatewayProtocol class in the protocols module.Decorator to register an event handler.
Signature
Parameters
No description available.
Returns
The result of the operation.
Decorator to register an event handler.
This is a method of the GatewayProtocol class in the protocols module.Decorator to register an event handler.
def on_event(event_type: Union[EventType, str]) -> Callable
@gateway.on_event(EventType.MESSAGE)
async def handle_message(event: GatewayEvent):
print(f"Message: {event.data}")