@@ -15,9 +15,12 @@ static TEXT_FAIL: &str = "Ha-ha... yaxshi urinish!";
1515static TEXT_NON_REPLY : & str = "↪ Reply bilan ko'rsatingchi habarni!" ;
1616static NON_COMMUNITY : & str = "Ebe hay, biz O'zbek Rust hamjamiyati guruhida emasga o'xshaymiz..." ;
1717
18+ static FLOSS_CHAT : ChatId = ChatId ( -1001303954475 ) ;
19+ static RUST_CHAT : ChatId = ChatId ( -1001518595284 ) ;
20+
1821pub async fn command ( bot : & Bot , msg : & Message , me : & Me , topics : & Topics ) -> ResponseResult < ( ) > {
19- // if chat is not rust uzbekistan , delete
20- if msg. chat . id != ChatId ( - 1001518595284 ) {
22+ // if chat is not community , delete
23+ if msg. chat . id != RUST_CHAT {
2124 return {
2225 bot. send_message_tf ( msg. chat . id , NON_COMMUNITY , msg) . await ?;
2326 Ok ( ( ) )
@@ -156,7 +159,7 @@ pub async fn callback(
156159 None => {
157160 return {
158161 bot. send_message (
159- ChatId ( - 1001518595284 ) ,
162+ RUST_CHAT ,
160163 "Qaysidir thread da xabarni tushuna olmadim, akalar meni loglarim qarab ko'rasizlarmi?" ,
161164 )
162165 . message_thread_id ( ThreadId ( MessageId ( 255895 ) ) )
@@ -242,9 +245,15 @@ pub async fn callback(
242245 }
243246 } ;
244247
245- let forward = bot. forward_message ( message. chat . id , message. chat . id , replied_message) ;
248+ // select where to forward message
249+ let forward = match c {
250+ 0 => bot. forward_message ( FLOSS_CHAT . to_string ( ) , message. chat . id , replied_message) ,
251+ _ => bot. forward_message ( message. chat . id , message. chat . id , replied_message) ,
252+ } ;
253+
254+ // if it has topic, appoint it
246255 match parsed_topic {
247- 1 => {
256+ 0 .. 1 => {
248257 forward. await ?;
249258 }
250259 _ => {
@@ -292,7 +301,7 @@ pub fn view_detail(from: (&str, &str), topic: String) -> String {
292301 {} guruhimizda ushbu mavzuga oid narsalar haqida suhbatlashish ruxsat etiladi. \
293302 Boshqalarga halaqit qilmayliga 😉\
294303 \n \n \
295- <b>Hurmat ila, Rustacean</b>",
304+ <b>Hurmat ila, Rustacean Menejer </b>",
296305 from. 0 ,
297306 from. 1 ,
298307 topic,
@@ -314,7 +323,7 @@ where
314323
315324 for ( index, topic) in list. iter ( ) . enumerate ( ) {
316325 keyboard. text (
317- & topic. capitalize ( ) ,
326+ topic,
318327 & format ! (
319328 "warn_{}_{}_{}_{}_{}" ,
320329 owner. 0 , topic, replied. 0 , name, replied_message
0 commit comments