You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[tracing::instrument(name = "Get last room from database", skip(db_client))]
pub async fn on_handle_next_room(db_client: &SqlitePool) -> Result<String, anyhow::Error> {
let room = sqlx::query!(
r#"
SELECT *
FROM rooms
WHERE available = true
ORDER BY created_at DESC
LIMIT 1
"#
)
.fetch_one(db_client)
.await
.map(|row| row.room_id).map_err(|e|{
tracing::error!("Failed to execute query: {:?}", e);
e
})?;
Ok(room)
}
#[tracing::instrument(name = "Count rooms from database", skip(db_client))]
pub async fn count_rooms(db_client: &SqlitePool) -> Result<i32, anyhow::Error> {
let result = sqlx::query!(
r#"
SELECT COUNT(*) AS count
FROM rooms
WHERE available = true
"#
)
.fetch_one(db_client)
.await
.map(|row| row.count)
.map_err(|e|{
tracing::error!("Failed to execute query: {:?}", e);
e
})?;
let count = result;
Ok(count)
}
Disclaimer: The bot password is not beign setted using the .env file, it can be tested with any matrix user, but for now you have to pass the password directly on the base.yml file.
The text was updated successfully, but these errors were encountered:
After fixing the bot logging, this error remains on file rooms.rs lines 143/176/197: https://github.com/ail3ngrimaldi/matrix-llm-bot/tree/to-sqlite
Disclaimer: The bot password is not beign setted using the .env file, it can be tested with any matrix user, but for now you have to pass the password directly on the base.yml file.
The text was updated successfully, but these errors were encountered: