telegram bot ui settings and code sending
This commit is contained in:
@@ -1392,6 +1392,20 @@ pub fn verify2fa(code: String) -> bool {
|
||||
res
|
||||
}
|
||||
|
||||
pub fn has_valid_bot() -> bool {
|
||||
crate::auth_2fa::TelegramBot::get().map_or(false, |bot| bot.is_some())
|
||||
}
|
||||
|
||||
pub fn verify_bot(token: String) -> String {
|
||||
match crate::auth_2fa::get_chatid_telegram(&token) {
|
||||
Err(err) => err.to_string(),
|
||||
Ok(None) => {
|
||||
"To activate the bot, simply send a message like \"hello\" to its chat.".to_owned()
|
||||
}
|
||||
_ => "".to_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_hwcodec() {
|
||||
#[cfg(feature = "hwcodec")]
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
|
||||
Reference in New Issue
Block a user