fix repls

This commit is contained in:
p0lunin 2021-12-26 19:59:13 +02:00
parent a644d0b6d2
commit 4452631fcc
2 changed files with 4 additions and 4 deletions

View file

@ -77,7 +77,7 @@ pub async fn commands_repl_with_listener<'a, R, Cmd, H, L, ListenerE, N, E, Args
{ {
let bot_name = bot_name.into(); let bot_name = bot_name.into();
let dispatcher = Dispatcher::new(Arc::new(requester)) let dispatcher = Dispatcher::new(requester)
.messages_handler(|h| h.add_command::<Cmd>(bot_name).branch(dptree::endpoint(handler))); .messages_handler(|h| h.add_command::<Cmd>(bot_name).branch(dptree::endpoint(handler)));
#[cfg(feature = "ctrlc_handler")] #[cfg(feature = "ctrlc_handler")]

View file

@ -59,11 +59,11 @@ pub async fn repl_with_listener<'a, R, H, E, L, ListenerE, Args>(
ListenerE: Debug, ListenerE: Debug,
Result<(), E>: OnError<E>, Result<(), E>: OnError<E>,
E: Debug + Send + Sync + 'static, E: Debug + Send + Sync + 'static,
R: Requester + Send + Sync + 'static, R: Requester + Clone + Send + Sync + 'static,
{ {
#[allow(unused_mut)] #[allow(unused_mut)]
let mut dispatcher = Dispatcher::new(Arc::new(requester)) let mut dispatcher =
.messages_handler(|h| h.branch(dptree::endpoint(handler))); Dispatcher::new(requester).messages_handler(|h| h.branch(dptree::endpoint(handler)));
#[cfg(feature = "ctrlc_handler")] #[cfg(feature = "ctrlc_handler")]
let mut dispatcher = dispatcher.setup_ctrlc_handler(); let mut dispatcher = dispatcher.setup_ctrlc_handler();