fn send<T: Serialize>(message: T, channel: &str, topic: &str, ttl: u16) -> bool {
	let seconds = format!("{}s", ttl);
	let payload = to_string(&json!({
		"method": "send",
		"params": {
			"options": {
				"channel": {
						"name": channel, "topic_name": topic, "topic_type": "dev"
					},
						"message": {
								"body": to_string(&message).unwrap()
							},
							"exploding_lifetime": seconds
						}
					}
				}
	))
	.unwrap();
	let response = api_send(&payload);
	match response["result"]["message"].as_str() {
		Some("message sent") => true,
		_ => false,
	}
}
/// Send a message to a keybase channel that self-destructs after ttl seconds.
Send a message to a keybase channel that self-destructs after ttl seconds.
Send a message to a keybase channel that self - destructs after ttl seconds .
fn send<T: Serialize>(message: T, channel: &str, topic: &str, ttl: u16) -> bool {
	let seconds = format!("{}s", ttl);
	let payload = to_string(&json!({
		"method": "send",
		"params": {
			"options": {
				"channel": {
						"name": channel, "topic_name": topic, "topic_type": "dev"
					},
						"message": {
								"body": to_string(&message).unwrap()
							},
							"exploding_lifetime": seconds
						}
					}
				}
	))
	.unwrap();
	let response = api_send(&payload);
	match response["result"]["message"].as_str() {
		Some("message sent") => true,
		_ => false,
	}
}
fn send < T : Serialize > ( message : T , channel : & str , topic : & str , ttl : u16 ) -> bool { let seconds = format ! ( " " ttl ) ; let payload = to_string ( & json ! ( { " " " " " " { " " { " " { " " channel " " topic " " " " } " " { " " to_string ( message ) unwrap ( ) } " " seconds } } } ) ) . unwrap ( ) ; let response = api_send ( & payload ) ; match response [ " " ] [ " " ] . as_str ( ) { Some ( " " ) => true , _ => false , } }
Send a message to a keybase channel that self-destructs after ttl seconds.
Send a message to a keybase channel that self - destructs after ttl seconds .
message
T
channel
&str
topic
&str
ttl
u16