21 lines
694 B
Rust
21 lines
694 B
Rust
use tenebrous_rpc::protos::dicebot::UserIdRequest;
|
|
use tenebrous_rpc::protos::dicebot::{dicebot_client::DicebotClient, GetVariableRequest};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
let mut client = DicebotClient::connect("http://0.0.0.0:9090").await?;
|
|
|
|
let request = tonic::Request::new(GetVariableRequest {
|
|
user_id: "@projectmoon:agnos.is".into(),
|
|
room_id: "!agICWvldGfuCywUVUM:agnos.is".into(),
|
|
variable_name: "stuff".into(),
|
|
});
|
|
|
|
let response = client.get_variable(request).await?.into_inner();
|
|
|
|
println!("RESPONSE={:?}", response);
|
|
println!("User friendly response is: {:?}", response.value);
|
|
|
|
Ok(())
|
|
}
|