TG almost works

This commit is contained in:
AB from home.homenet
2025-10-19 04:13:36 +03:00
parent 42c8016d9c
commit d972f10f83
31 changed files with 3302 additions and 427 deletions

View File

@@ -126,15 +126,6 @@ impl UserRepository {
Ok(count > 0)
}
/// Get all Telegram admins
pub async fn get_telegram_admins(&self) -> Result<Vec<Model>> {
let admins = User::find()
.filter(Column::IsTelegramAdmin.eq(true))
.order_by_desc(Column::CreatedAt)
.all(&self.db)
.await?;
Ok(admins)
}
/// Set user as Telegram admin
pub async fn set_telegram_admin(&self, user_id: Uuid, is_admin: bool) -> Result<Option<Model>> {
@@ -167,6 +158,16 @@ impl UserRepository {
Ok(false)
}
}
/// Get all Telegram admins
pub async fn get_telegram_admins(&self) -> Result<Vec<Model>> {
let admins = User::find()
.filter(Column::IsTelegramAdmin.eq(true))
.filter(Column::TelegramId.is_not_null())
.all(&self.db)
.await?;
Ok(admins)
}
}
#[cfg(test)]