pass_manager/src/utils.rs

20 lines
473 B
Rust

use crate::prelude::*;
/// Deletes the message ignoring the errors
#[inline]
pub async fn delete_message(bot: Throttle<Bot>, msg: Message) {
let _ = bot.delete_message(msg.chat.id, msg.id).await;
}
#[inline]
pub async fn name_from_hash(
db: &DatabaseConnection,
user_id: u64,
hash: &[u8],
) -> crate::Result<Option<String>> {
let hash = hex::encode(hash);
Account::get_name_by_hash(user_id, hash, db)
.await
.map_err(Into::into)
}