Fix hello_world example

This commit is contained in:
Jonas Platte 2020-05-22 17:58:25 +02:00
parent 4ec060071d
commit 326e705468
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -10,6 +10,7 @@ use ruma_client::{
identifiers::RoomAliasId,
Client,
};
use serde_json::value::to_raw_value as to_raw_json_value;
use url::Url;
async fn hello_world(homeserver_url: Url, room: String) -> anyhow::Result<()> {
@ -36,13 +37,12 @@ async fn hello_world(homeserver_url: Url, room: String) -> anyhow::Result<()> {
room_id,
event_type: EventType::RoomMessage,
txn_id: "1".to_owned(),
data: MessageEventContent::Text(TextMessageEventContent {
data: to_raw_json_value(&MessageEventContent::Text(TextMessageEventContent {
body: "Hello World!".to_owned(),
format: None,
formatted_body: None,
relates_to: None,
})
.into(),
}))?,
})
.await?;