293 Commits

Author SHA1 Message Date
Akulij
f5d108d350 add debug info when calling js handler
Some checks failed
Build && Deploy / cargo build (push) Has been cancelled
2025-05-31 14:32:23 +05:00
Akulij
714853730a create /cancel command for users 2025-05-31 13:47:14 +05:00
Akulij
b980a653cb attach user_application to runner 2025-05-31 13:46:54 +05:00
Akulij
b8d07d0ad5 create MessageForward.store_db to store by DB type
reason: easier to use with RwLock
2025-05-31 13:45:45 +05:00
Akulij
2e447e87fd create Application.store_db to store by DB type 2025-05-31 13:45:02 +05:00
Akulij
d749b57811 call js function handler if set in script_handler 2025-05-31 13:43:41 +05:00
Akulij
a106891050 create call_attacher for Runner to attach global objects on initialization 2025-05-31 13:42:54 +05:00
Akulij
9cd0765030 create BotMessage js function handler getter 2025-05-31 13:42:10 +05:00
Akulij
bc46e0fda4 create BotFunction context getter 2025-05-31 13:41:42 +05:00
Akulij
845071c800 create botscript application module for js's runtime user_application function 2025-05-31 13:39:17 +05:00
Akulij
bee93b32d1 use BotController 2025-05-31 10:48:52 +05:00
Akulij
0265942449 enable Send for BotController 2025-05-31 10:48:15 +05:00
Akulij
e993a6c941 derive Clone on Config 2025-05-31 10:47:49 +05:00
Akulij
6dfe9b839d fix logic: move bot insertion to db to /deploy command, instead of function in bot_manager 2025-05-31 10:45:34 +05:00
Akulij
f27fb670bd create BotManager 2025-05-31 10:43:05 +05:00
Akulij
22025cde11 handle callbacks in script_handler 2025-05-31 10:35:52 +05:00
Akulij
3bd16a58cd add replace flag to BotMessage 2025-05-31 10:34:29 +05:00
Akulij
474795bd99 create RunnerConfig.get_callback_message 2025-05-31 10:34:06 +05:00
Akulij
fdf1e352a6 add buttons field to BotDialog 2025-05-31 10:33:26 +05:00
Akulij
39e376195c create BotInstance::update_script 2025-05-31 10:31:09 +05:00
Akulij
308b15ed69 create BotInstance::restart_one and restart_all 2025-05-31 10:30:39 +05:00
Akulij
102fae25c7 create BotInstance::get_by_name 2025-05-31 10:30:03 +05:00
Akulij
bc2397a32c derive Clone for BotInstance 2025-05-31 10:29:03 +05:00
Akulij
fde7087172 create /newscript command handler 2025-05-31 10:28:22 +05:00
Akulij
67ad3c2acd plug provided handlers in start_bot 2025-05-28 11:11:25 +05:00
Akulij
866a028de1 move out bot handlers to separate module 2025-05-28 11:10:32 +05:00
Akulij
e63187dcd3 rename botscript_command_handler to more correct handle_botmessage 2025-05-28 10:15:30 +05:00
Akulij
098cff72bd delete inspector in botscript handler 2025-05-28 10:14:14 +05:00
Akulij
d428c8798d make script_handler return a public type 2025-05-27 15:35:40 +05:00
Akulij
6eb6f2f454 fix: start bot with it's db name 2025-05-27 15:34:50 +05:00
Akulij
2fdd8a346d fix: instead of actually starting bot on /deploy, just put info in DB
reason: it's not a responsibility of /deploy command to store bot info
AND starting bot thread, isntead it is responsible only for storing info
in DB, as every other command does, and then bot will lazily start by
bot manager
2025-05-27 15:12:14 +05:00
Akulij
d10acc992a start bot instances in main 2025-05-27 14:21:36 +05:00
Akulij
8e3c647727 fix: handle io and RwLock error for bot manager 2025-05-27 14:20:02 +05:00
Akulij
8fed0daf4c extend BotController creation implementation 2025-05-27 14:17:29 +05:00
Akulij
e1b6b5aa10 derive Clone for BotController 2025-05-27 14:14:23 +05:00
Akulij
4a35243a4c store RunnerConfig in BotController as atomic rw lock for thread safety 2025-05-27 14:13:28 +05:00
Akulij
1757571f35 create bot_name field in Config 2025-05-27 14:11:33 +05:00
Akulij
77ba6dcfc5 define const MAIN_BOT_SCRIPT 2025-05-27 14:10:48 +05:00
Akulij
6ac3665dee fix: add bot_handler to compile tree 2025-05-27 04:17:26 +05:00
Akulij
ef5d74cf1c create bot_manager module to handle background bot start 2025-05-27 04:17:05 +05:00
Akulij
a136558681 create MongodbStorage::from_db initializer 2025-05-27 04:09:47 +05:00
Akulij
9e99064bc5 create DB.with_name method 2025-05-27 04:09:05 +05:00
Akulij
3acd168155 make Runner thread safe 2025-05-27 04:08:27 +05:00
Akulij
4be9c034c9 use variable db name instead of hardcoded one 2025-05-26 20:50:25 +05:00
Akulij
9bbf481002 derive Clone on bot and runner config 2025-05-26 20:48:11 +05:00
Akulij
4384431696 create RunnerConfig::init_with_db 2025-05-26 20:47:35 +05:00
Akulij
ff7f317ae5 create attach_db_obj for botscript 2025-05-26 20:44:34 +05:00
Akulij
aac968e408 add RawCallError to ScriptError 2025-05-26 20:43:04 +05:00
Akulij
cb7c888028 create RawCall trait, that will contain DB methods to call from script runtime 2025-05-26 20:22:46 +05:00
Akulij
a33d4b393c impl GetCollection for CallDB 2025-05-26 20:16:12 +05:00