delete inspector in botscript handler
This commit is contained in:
parent
d428c8798d
commit
098cff72bd
@ -23,13 +23,11 @@ pub type BotHandler =
|
|||||||
Handler<'static, DependencyMap, BotResult<()>, teloxide::dispatching::DpHandlerDescription>;
|
Handler<'static, DependencyMap, BotResult<()>, teloxide::dispatching::DpHandlerDescription>;
|
||||||
|
|
||||||
pub fn script_handler(rc: Arc<RwLock<RunnerConfig>>) -> BotHandler {
|
pub fn script_handler(rc: Arc<RwLock<RunnerConfig>>) -> BotHandler {
|
||||||
dptree::entry()
|
dptree::entry().branch(
|
||||||
.inspect(|u: Update| {
|
|
||||||
info!("{u:#?}"); // Print the update to the console with inspect
|
|
||||||
})
|
|
||||||
.branch(
|
|
||||||
Update::filter_message()
|
Update::filter_message()
|
||||||
|
// check if message is command
|
||||||
.filter_map(|m: Message| m.text().and_then(|t| BotCommand::from_str(t).ok()))
|
.filter_map(|m: Message| m.text().and_then(|t| BotCommand::from_str(t).ok()))
|
||||||
|
// check if command is presented in config
|
||||||
.filter_map(move |bc: BotCommand| {
|
.filter_map(move |bc: BotCommand| {
|
||||||
let rc = std::sync::Arc::clone(&rc);
|
let rc = std::sync::Arc::clone(&rc);
|
||||||
let command = bc.command();
|
let command = bc.command();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user