bugfixes #15
2 changed files with 7 additions and 3 deletions
|
@ -50,7 +50,7 @@ pub fn parse_metadata(page: &str) -> Option<Embed> {
|
|||
(None, None) => {
|
||||
warn!("Couldn't parse any metadata for URL");
|
||||
return None;
|
||||
},
|
||||
}
|
||||
// Otherwise set the title/description to whatever we find
|
||||
(Some(title), Some(desc)) => {
|
||||
meta_title = title.text().collect();
|
||||
|
@ -139,7 +139,8 @@ pub async fn embed_handler(event: OriginalSyncRoomMessageEvent, room: Room, clie
|
|||
}
|
||||
|
||||
// Build our message reply
|
||||
let embed = metadata.unwrap_or(Embed::new("No metadata found".to_string(), "".to_string()));
|
||||
let embed = metadata
|
||||
.unwrap_or(Embed::new("No metadata found".to_string(), "".to_string()));
|
||||
let bot_reply = RoomMessageEventContent::text_html(
|
||||
&embed.title,
|
||||
format!(
|
||||
|
|
|
@ -142,7 +142,10 @@ pub async fn run(config: Config) -> anyhow::Result<()> {
|
|||
.expect("frogbot couldn't log into it's account.");
|
||||
|
||||
// Set the bot account's display name according to config
|
||||
client.account().set_display_name(Some(&config.display_name)).await?;
|
||||
client
|
||||
.account()
|
||||
.set_display_name(Some(&config.display_name))
|
||||
.await?;
|
||||
|
||||
warn!("Logged in successfully!");
|
||||
warn!(
|
||||
|
|
Loading…
Reference in a new issue