Function lotus_script::message::send_message
source · pub fn send_message<T>(message: &T, targets: impl IntoMessageTargets)where
T: MessageType,
Expand description
Sends the message to the given targets.
§Example
// Send a message with only a single target
send_message(&TestMessage { value: 42 }, MessageTarget::Myself);
// Send a message to multiple targets
send_message(&TestMessage { value: 42 }, [MessageTarget::Myself, MessageTarget::ChildByIndex(0)]);