From 3d9a1c31b463bbc1dd0ec3e88bccdc3563262fbc Mon Sep 17 00:00:00 2001 From: Akulij Date: Tue, 20 May 2025 00:42:32 +0500 Subject: [PATCH] use RunnerConfig in BotController --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1e47d0b..1bd8ada 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ pub mod db; pub mod mongodb_storage; pub mod utils; +use botscript::{Runner, RunnerConfig}; use db::application::Application; use db::callback_info::CallbackInfo; use db::message_forward::MessageForward; @@ -98,6 +99,7 @@ type CallbackStore = CallbackInfo; pub struct BotController { pub bot: Bot, pub db: DB, + pub rc: RunnerConfig, } impl BotController { @@ -105,7 +107,9 @@ impl BotController { let bot = Bot::new(&config.bot_token); let db = DB::init(&config.db_url).await?; - Ok(Self { bot, db }) + let rc = Runner::init()?.init_config(include_str!("../mainbot.js"))?; + + Ok(Self { bot, db, rc }) } }