@@ -112,14 +112,10 @@ impl TweetSynchronizerService {
112112 let link = build_x_status_url ( author_name, & tweet. id ) ;
113113
114114 let tg_message = format ! (
115- "Raid Target Found!\n \n *Link*: {}\n *Author*: {}\n *Text*: {}\n *Impressions*: {}\n *Posted At*: {}" ,
116- TelegramService :: escape_markdown_v2( & link) ,
117- TelegramService :: escape_markdown_v2( author_name) ,
118- TelegramService :: escape_markdown_v2( & tweet. text) ,
119- tweet. impression_count,
120- tweet. created_at
115+ "**Raid Target Found!**\n \n **Link**: {}\n **Author**: {}\n **Text**: {}\n **Impressions**: {}\n **Posted At**: {}" ,
116+ & link, author_name, & tweet. text, tweet. impression_count, tweet. created_at
121117 ) ;
122- messages. push ( tg_message) ;
118+ messages. push ( TelegramService :: escape_markdown_v2 ( & tg_message) ) ;
123119 }
124120
125121 tokio:: spawn ( async move {
@@ -222,7 +218,7 @@ impl TweetSynchronizerService {
222218#[ cfg( test) ]
223219mod tests {
224220 use super :: * ;
225- use crate :: config:: Config ;
221+ use crate :: config:: { Config , TelegramBotConfig } ;
226222 use crate :: models:: raid_quest:: CreateRaidQuest ;
227223 use crate :: utils:: test_db:: reset_database;
228224 use mockall:: predicate:: * ;
@@ -253,11 +249,13 @@ mod tests {
253249
254250 // B. Setup Telegram Mock Server
255251 let mock_server = MockServer :: start ( ) . await ;
256- let telegram_service = Arc :: new ( TelegramService :: new (
257- & mock_server. uri ( ) ,
258- "123456" ,
259- & config. tg_bot . chat_id ,
260- ) ) ;
252+ let telegram_config = TelegramBotConfig {
253+ base_url : mock_server. uri ( ) ,
254+ token : "123456" . to_string ( ) ,
255+ chat_id : config. tg_bot . chat_id . clone ( ) ,
256+ message_thread_id : config. tg_bot . message_thread_id . clone ( ) ,
257+ } ;
258+ let telegram_service = Arc :: new ( TelegramService :: new ( telegram_config) ) ;
261259
262260 // C. Config
263261 let app_config = Arc :: new ( config) ;
0 commit comments