pub type Action = Decision;Expand description
The answer to a decision hook: the contract’s decision variant, which is
action plus DenyJson and MessageJson for rich text (since 0.1.2).
The SDK answers through the decisions export, which hosts from 0.1.2
call. An older host calls the handler hooks instead and shows the rich
cases as their plain words.
Aliased Type§
pub enum Action {
Continue,
Deny(String),
Server(String),
Message(String),
Queue(String),
LeaveQueue,
DenyJson(String),
MessageJson(String),
}Variants§
Continue
Deny(String)
Server(String)
Message(String)
Queue(String)
LeaveQueue
DenyJson(String)
MessageJson(String)
Implementations§
Source§impl Action
impl Action
Sourcepub fn deny_json(reason: impl ToString) -> Self
pub fn deny_json(reason: impl ToString) -> Self
deny-json(reason): a JSON text component of at most 32 KiB, given
as a serde_json::Value or as JSON text.
Sourcepub fn message(text: impl Into<String>) -> Self
pub fn message(text: impl Into<String>) -> Self
message(text): reply to the player who ran a command.
Sourcepub fn message_json(text: impl ToString) -> Self
pub fn message_json(text: impl ToString) -> Self
message-json(text): reply with a JSON text component of at most
32 KiB, given as a serde_json::Value or as JSON text.