Former-commit-id: d9b18abd55
This commit is contained in:
Maybe Waffle 2022-10-07 12:19:54 +04:00
parent a3632d65da
commit bb686ebd8e
2 changed files with 6 additions and 8 deletions

View file

@ -3,13 +3,12 @@ use crate::{
update_listeners, update_listeners::UpdateListener, HandlerExt, UpdateFilterExt,
},
error_handlers::LoggingErrorHandler,
requests::{Requester, ResponseResult},
types::Update,
utils::command::BotCommands,
RequestError,
};
use dptree::di::{DependencyMap, Injectable};
use std::{fmt::Debug, marker::PhantomData};
use teloxide_core::requests::Requester;
/// A [REPL] for commands.
//
@ -58,7 +57,7 @@ pub async fn commands_repl<'a, R, Cmd, H, Args>(bot: R, handler: H, cmd: Phantom
where
R: Requester + Clone + Send + Sync + 'static,
<R as Requester>::GetUpdates: Send,
H: Injectable<DependencyMap, Result<(), RequestError>, Args> + Send + Sync + 'static,
H: Injectable<DependencyMap, ResponseResult<()>, Args> + Send + Sync + 'static,
Cmd: BotCommands + Send + Sync + 'static,
{
let cloned_bot = bot.clone();
@ -123,7 +122,7 @@ pub async fn commands_repl_with_listener<'a, R, Cmd, H, L, Args>(
cmd: PhantomData<Cmd>,
) where
Cmd: BotCommands + Send + Sync + 'static,
H: Injectable<DependencyMap, Result<(), RequestError>, Args> + Send + Sync + 'static,
H: Injectable<DependencyMap, ResponseResult<()>, Args> + Send + Sync + 'static,
L: UpdateListener + Send + 'a,
L::Err: Debug + Send + 'a,
R: Requester + Clone + Send + Sync + 'static,

View file

@ -1,12 +1,11 @@
use crate::{
dispatching::{update_listeners, update_listeners::UpdateListener, UpdateFilterExt},
error_handlers::LoggingErrorHandler,
requests::{Requester, ResponseResult},
types::Update,
RequestError,
};
use dptree::di::{DependencyMap, Injectable};
use std::fmt::Debug;
use teloxide_core::requests::Requester;
/// A [REPL] for messages.
//
@ -47,7 +46,7 @@ pub async fn repl<R, H, Args>(bot: R, handler: H)
where
R: Requester + Send + Sync + Clone + 'static,
<R as Requester>::GetUpdates: Send,
H: Injectable<DependencyMap, Result<(), RequestError>, Args> + Send + Sync + 'static,
H: Injectable<DependencyMap, ResponseResult<()>, Args> + Send + Sync + 'static,
{
let cloned_bot = bot.clone();
repl_with_listener(bot, handler, update_listeners::polling_default(cloned_bot).await).await;
@ -94,7 +93,7 @@ where
pub async fn repl_with_listener<R, H, L, Args>(bot: R, handler: H, listener: L)
where
R: Requester + Clone + Send + Sync + 'static,
H: Injectable<DependencyMap, Result<(), RequestError>, Args> + Send + Sync + 'static,
H: Injectable<DependencyMap, ResponseResult<()>, Args> + Send + Sync + 'static,
L: UpdateListener + Send,
L::Err: Debug,
{