fn decode_msg_json(obj: json::Object) -> Result<Event, EventDecodingError> {
    // Messages with a `subtype` are not plain text messages.. Not interested in them for now.
    if obj.contains_key("subtype") {
        return Ok(Event::Message(Msg::Other(obj)))
    }

    // It's a plain message.
    Ok(Event::Message(Msg::Plain(MessageData {
        text: get_json_string!(obj, "text"),
        channel: get_json_string!(obj, "channel"),
        user: get_json_string!(obj, "user"),
        ts: get_json_string!(obj, "ts"),
        team: get_json_string!(obj, "team"),
    })))
}
/// Decode the Event::Message data
Decode the Event::Message data
Decode the Event :: Message data
fn decode_msg_json(obj: json::Object) -> Result<Event, EventDecodingError> {
    // Messages with a `subtype` are not plain text messages.. Not interested in them for now.
    if obj.contains_key("subtype") {
        return Ok(Event::Message(Msg::Other(obj)))
    }
    // It's a plain message.
    Ok(Event::Message(Msg::Plain(MessageData {
        text: get_json_string!(obj, "text"),
        channel: get_json_string!(obj, "channel"),
        user: get_json_string!(obj, "user"),
        ts: get_json_string!(obj, "ts"),
        team: get_json_string!(obj, "team"),
    })))
}
fn decode_msg_json ( obj : json :: Object ) -> Result < Event , EventDecodingError > { // Messages with a `subtype` are not plain text messages.. Not interested in them for now. if obj . contains_key ( " " ) { return Ok ( Event :: Message ( Msg :: Other ( obj ) ) ) } // It's a plain message. Ok ( Event :: Message ( Msg :: Plain ( MessageData { text : get_json_string ! ( obj " " ) , channel : get_json_string ! ( obj " " ) , user : get_json_string ! ( obj " " ) , ts : get_json_string ! ( obj " " ) , team : get_json_string ! ( obj " " ) , } ) ) ) }
Decode the Event::Message data
Decode the Event :: Message data
obj
json::Object
obj
json::Object