bugfixes #15

Manually merged
froge merged 5 commits from bugfixes into master 2023-10-08 04:08:12 +00:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 7d379448ff - Show all commits

View file

@ -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!(

View file

@ -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!(