#[non_exhaustive]pub enum ClientCommandContents {
Startup,
Context {
message: Cow<'static, str>,
silent: bool,
},
RegisterActions {
actions: Vec<Action>,
},
UnregisterActions {
action_names: Vec<Cow<'static, str>>,
},
ForceActions {
state: Option<Cow<'static, str>>,
query: Cow<'static, str>,
ephemeral_context: Option<bool>,
action_names: Vec<Cow<'static, str>>,
},
ActionResult {
id: String,
success: bool,
message: Option<Cow<'static, str>>,
},
}Expand description
Client command contents (everything except the game field). See ClientCommand docs for more
info.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Startup
This message should be sent as soon as the game starts, to let Neuro know that the game is running.
This message clears all previously registered actions for this game and does initial setup, and as such should be the very first message that you send.
Context
This message can be sent to let Neuro know about something that is happening in game.
Fields
RegisterActions
This message registers one or more actions for Neuro to use.
Fields
UnregisterActions
This message unregisters one or more actions, preventing Neuro from using them anymore.
Fields
ForceActions
This message forces Neuro to execute one of the listed actions as soon as possible. Note that this might take a bit if she is already talking.
Fields
state: Option<Cow<'static, str>>An arbitrary string that describes the current state of the game. This can be plaintext, JSON, Markdown, or any other format. This information will be directly received by Neuro.
query: Cow<'static, str>A plaintext message that tells Neuro what she is currently supposed to be doing (e.g. "It is now your turn. Please perform an action. If you want to use any items, you should use them before picking up the shotgun."). This information will be directly received by Neuro.
ActionResult
This message needs to be sent as soon as possible after an action is validated, to allow Neuro to continue.
§Important
Until you send an action result, Neuro will just be waiting for the result of her action! Please make sure to send this as soon as possible. It should usually be sent after validating the action parameters, before it is actually executed in-game.
§Tip
Since setting success to false will retry the action force if there was one, if the action was not successful but you don’t want it to be retried, you should set success to true and provide an error message in the message field.
Fields
id: StringThe id of the action that this result is for. This is grabbed from the action message directly.
success: boolWhether or not the action was successful. If this is false and this action is part of an actions force, the whole actions force will be immediately retried by Neuro.
message: Option<Cow<'static, str>>A plaintext message that describes what happened when the action was executed. If not successful, this should be an error message. If successful, this can either be empty, or provide a small context to Neuro regarding the action she just took (e.g. "Remember to not share this with anyone."). This information will be directly received by Neuro.
Trait Implementations§
Source§impl Clone for ClientCommandContents
impl Clone for ClientCommandContents
Source§fn clone(&self) -> ClientCommandContents
fn clone(&self) -> ClientCommandContents
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientCommandContents
impl Debug for ClientCommandContents
Source§impl<'de> Deserialize<'de> for ClientCommandContents
impl<'de> Deserialize<'de> for ClientCommandContents
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ClientCommandContents
impl PartialEq for ClientCommandContents
Source§fn eq(&self, other: &ClientCommandContents) -> bool
fn eq(&self, other: &ClientCommandContents) -> bool
self and other values to be equal, and is used by ==.