no @ started name supported
This commit is contained in:
		@@ -39,20 +39,28 @@ pub async fn inline_menu(db: &Controller, bot: &Bot, q: InlineQuery) -> Result<(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    results.push(InlineQueryResult::Article(InlineQueryResultArticle::new(
 | 
					    results.push(InlineQueryResult::Article(InlineQueryResultArticle::new(
 | 
				
			||||||
        name.clone(),
 | 
					        name.clone(),
 | 
				
			||||||
        format!("{} {}", BOT_TEXT_INLINE_HANG, name),
 | 
					        format!("{} {}", BOT_TEXT_INLINE_HANG, name.clone()),
 | 
				
			||||||
        InputMessageContent::Text(InputMessageContentText::new(hangit_text(
 | 
					        InputMessageContent::Text(InputMessageContentText::new(hangit_text(
 | 
				
			||||||
            name,
 | 
					            name.clone(),
 | 
				
			||||||
            !IS_SELF,
 | 
					            !IS_SELF,
 | 
				
			||||||
            !NEED_ESCAPE,
 | 
					            !NEED_ESCAPE,
 | 
				
			||||||
        ))),
 | 
					        ))),
 | 
				
			||||||
    )));
 | 
					    )));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if name.starts_with("@") {
 | 
				
			||||||
 | 
					        results = vec![]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bot.answer_inline_query(&q.id, results).send().await?;
 | 
					    bot.answer_inline_query(&q.id, results).send().await?;
 | 
				
			||||||
    Ok(())
 | 
					    Ok(())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub async fn inline_anwser(db: &Controller, a: ChosenInlineResult) -> Result<(), RequestError> {
 | 
					pub async fn inline_anwser(db: &Controller, a: ChosenInlineResult) -> Result<(), RequestError> {
 | 
				
			||||||
    log_debug_ln!("{:#?}", a);
 | 
					    log_debug_ln!("{:#?}", a);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if a.result_id == "@" {
 | 
				
			||||||
 | 
					        return Ok(());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if let Err(err) = db.hangit(&a.result_id, ChatId(0)).await {
 | 
					    if let Err(err) = db.hangit(&a.result_id, ChatId(0)).await {
 | 
				
			||||||
        log_error_ln!("{:?}", err);
 | 
					        log_error_ln!("{:?}", err);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user