on
Register an event listener for state changes on this message. The handler is
called each time a messaging.state event is received for this message, allowing
you to react to intermediate states before the terminal state is reached.
Parameters
handler
A function or coroutine that receives a RelayEvent
on each state change. Both synchronous and async handlers are supported.
Returns
None