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
593316d541
cargo add lazy_static
2025-05-27 04:15:39 +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
13a861e74b
cargo add serde_json
2025-05-26 20:45:59 +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
Akulij
9c15b0a375
create DbCollection and GetCollection traits
2025-05-26 20:15:27 +05:00
Akulij
4c149b6922
create BotInstance collection
2025-05-26 20:12:46 +05:00
Akulij
a7433cd8cc
create /deploy admin command
2025-05-26 20:10:12 +05:00
Akulij
bdb30c8d98
create default script for new bots
2025-05-26 20:08:55 +05:00
Akulij
d1c1b7500d
create script_handler function that creates teloxide's handler for botscript dispatch
2025-05-26 20:06:07 +05:00
Akulij
d5dbaa0b75
refactor message answer and replace
2025-05-25 09:40:41 +05:00
Akulij
4548419946
implement botscript_command_handler
2025-05-23 16:36:34 +05:00
Akulij
e8dbf3db76
access RunnerConfig instead of manually using commands hash map
2025-05-23 16:29:54 +05:00
Akulij
1ff86f641f
impl RunnerConfig::get_command_message
2025-05-23 16:27:06 +05:00
Akulij
31e78be68f
change interface for ResolveValue
2025-05-23 16:26:35 +05:00
Akulij
217a074c95
create ResolveError
2025-05-23 16:24:17 +05:00
Akulij
1c17639c0e
handle DbError in ScriptError
2025-05-23 16:23:54 +05:00
Akulij
9e35f4168e
use DB and join_all
2025-05-23 16:23:12 +05:00
Akulij
178f2a2399
create ButtonRaw name, callback_name and literal getters
2025-05-23 16:21:26 +05:00
Akulij
1730107e9a
create BotMessage.literal getter
2025-05-23 16:20:21 +05:00
Akulij
506fdcb260
create BotMessage.resolve_buttons
2025-05-23 16:19:37 +05:00
Akulij
6d5f748ab8
create ButtonLayout::resolve_raw
2025-05-23 16:15:44 +05:00
Akulij
cbb9c0c335
botscript: create ButtonLayout enum
2025-05-23 16:13:56 +05:00
Akulij
f8c63e5315
create BotMessage.fill_literal method
2025-05-23 16:04:03 +05:00
Akulij
66180e0cfb
add optional literal string in BotMessage
2025-05-23 16:03:12 +05:00
Akulij
1117af0724
impl ButtonName.resolve_name
2025-05-23 15:49:30 +05:00
Akulij
99758500b3
fix mainbot.js: start_buttons: return actual buttons
2025-05-23 15:29:22 +05:00
Akulij
d174ee7bc7
fix: handle Runner in BotController
...
reason: earlier, Runner and js runtime in it were freed after init of
BotController, which potentially was able to lead into hanging function
in config without runtime, BUT, there is check in in JS_FreeRuntime to
have zero objects, so bug found without hesitation ;)
2025-05-21 14:07:02 +05:00
Akulij
ca2e661a0e
fix: in Runner's init_config use deserialize_js instead of js_into
2025-05-21 14:06:09 +05:00
Akulij
c33c67044a
delete test test_deserialization_main, since it isnot actual anymore
2025-05-21 13:04:08 +05:00
Akulij
d1b6d153d4
create call and call_args methods for BotFunction
2025-05-21 12:53:26 +05:00
Akulij
0dc71fda08
fix BotFunction's call_context method
...
previously called by stored template string instead of actual function
2025-05-21 12:46:46 +05:00
Akulij
970ce07280
fix name of stateful_msg_handlers in Parcelable field getter
2025-05-21 12:41:04 +05:00
Akulij
940a832561
mainbot.js: use function in handler instead of string function name
2025-05-21 12:33:03 +05:00