diff --git a/polesDB b/polesDB index 260056f..c6ab948 100644 Binary files a/polesDB and b/polesDB differ diff --git a/src/lib.rs b/src/lib.rs index cb8295d..7fe3592 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,8 @@ enum Command { Top, #[command(description = "get the server time")] Time, + #[command(description = "get the bot version")] + Version, } /*#[tokio::main] @@ -117,6 +119,7 @@ async fn answer(bot: Bot, msg: Message, command: Command) -> anyhow::Result<()> ) .await? } + Command::Version => bot.send_message(msg.chat.id, "0.2.5").await?, }; Ok(()) diff --git a/src/rewrite_links/links_to_rewrite.rs b/src/rewrite_links/links_to_rewrite.rs index ab0341a..39ddb2a 100644 --- a/src/rewrite_links/links_to_rewrite.rs +++ b/src/rewrite_links/links_to_rewrite.rs @@ -94,3 +94,14 @@ fn test_rewrite_refered_tiktok() { Some("https://vxtiktok.com/@/video/7417808362957589778".to_string()) ); } + +#[test] +fn test_rewrite_refered_instagram() { + let url_and_domain = + get_domain_from_text("https://www.instagram.com/reel/DJAE4JXSvHn/".to_string()); + let domain = filter_string(url_and_domain.0, url_and_domain.1); + assert_eq!( + domain, + Some("https://ddinstagram.com/reel/DJAE4JXSvHn/".to_string()) + ); +}