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) => { |         (None, None) => { | ||||||
|             warn!("Couldn't parse any metadata for URL"); |             warn!("Couldn't parse any metadata for URL"); | ||||||
|             return None; |             return None; | ||||||
|         }, |         } | ||||||
|         // Otherwise set the title/description to whatever we find
 |         // Otherwise set the title/description to whatever we find
 | ||||||
|         (Some(title), Some(desc)) => { |         (Some(title), Some(desc)) => { | ||||||
|             meta_title = title.text().collect(); |             meta_title = title.text().collect(); | ||||||
|  | @ -139,7 +139,8 @@ pub async fn embed_handler(event: OriginalSyncRoomMessageEvent, room: Room, clie | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     // Build our message reply
 |                     // 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( |                     let bot_reply = RoomMessageEventContent::text_html( | ||||||
|                         &embed.title, |                         &embed.title, | ||||||
|                         format!( |                         format!( | ||||||
|  |  | ||||||
|  | @ -142,7 +142,10 @@ pub async fn run(config: Config) -> anyhow::Result<()> { | ||||||
|         .expect("frogbot couldn't log into it's account."); |         .expect("frogbot couldn't log into it's account."); | ||||||
| 
 | 
 | ||||||
|     // Set the bot account's display name according to config
 |     // 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!("Logged in successfully!"); | ||||||
|     warn!( |     warn!( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue