migration to JS engine #1

Merged
akulij merged 131 commits from dev into main 2025-05-31 08:49:52 +00:00
Showing only changes of commit 39e376195c - Show all commits

View File

@ -75,4 +75,19 @@ impl BotInstance {
.await?;
Ok(())
}
pub async fn update_script<D: CallDB>(db: &mut D, name: &str, script: &str) -> DbResult<()> {
let bi = db.get_collection::<Self>().await;
bi.update_one(
doc! {"name": name},
doc! { "$set": {
"script": script,
"restart_flag": true,
}
},
)
.await?;
Ok(())
}
}