HandlerExt::add_dialogue => HandlerExt::enter_dialogue

This commit is contained in:
Hirrolot 2022-02-04 20:00:21 +06:00
parent 8eb8e3c720
commit e5330cdec2
5 changed files with 6 additions and 6 deletions

View file

@ -223,7 +223,7 @@ async fn main() {
DispatcherBuilder::new( DispatcherBuilder::new(
bot, bot,
Update::filter_message() Update::filter_message()
.add_dialogue::<Message, InMemStorage<State>, State>() .enter_dialogue::<Message, InMemStorage<State>, State>()
.dispatch_by::<State>(), .dispatch_by::<State>(),
) )
.dependencies(dptree::deps![InMemStorage::<State>::new()]) .dependencies(dptree::deps![InMemStorage::<State>::new()])

View file

@ -49,7 +49,7 @@ async fn main() {
DispatcherBuilder::new( DispatcherBuilder::new(
bot, bot,
Update::filter_message() Update::filter_message()
.add_dialogue::<Message, InMemStorage<State>, State>() .enter_dialogue::<Message, InMemStorage<State>, State>()
.dispatch_by::<State>(), .dispatch_by::<State>(),
) )
.dependencies(dptree::deps![InMemStorage::<State>::new()]) .dependencies(dptree::deps![InMemStorage::<State>::new()])

View file

@ -44,7 +44,7 @@ async fn main() {
let storage = RedisStorage::open("redis://127.0.0.1:6379", Bincode).await.unwrap(); let storage = RedisStorage::open("redis://127.0.0.1:6379", Bincode).await.unwrap();
let handler = Update::filter_message() let handler = Update::filter_message()
.add_dialogue::<Message, RedisStorage<Bincode>, State>() .enter_dialogue::<Message, RedisStorage<Bincode>, State>()
.dispatch_by::<State>(); .dispatch_by::<State>();
DispatcherBuilder::new(bot, handler) DispatcherBuilder::new(bot, handler)

View file

@ -40,7 +40,7 @@ async fn main() {
let storage = SqliteStorage::open("db.sqlite", Json).await.unwrap(); let storage = SqliteStorage::open("db.sqlite", Json).await.unwrap();
let handler = Update::filter_message() let handler = Update::filter_message()
.add_dialogue::<Message, SqliteStorage<Json>, State>() .enter_dialogue::<Message, SqliteStorage<Json>, State>()
.dispatch_by::<State>(); .dispatch_by::<State>();
DispatcherBuilder::new(bot, handler) DispatcherBuilder::new(bot, handler)

View file

@ -24,7 +24,7 @@ pub trait HandlerExt<Output> {
C: BotCommand + Send + Sync + 'static; C: BotCommand + Send + Sync + 'static;
#[must_use] #[must_use]
fn add_dialogue<Upd, S, D>(self) -> Self fn enter_dialogue<Upd, S, D>(self) -> Self
where where
S: Storage<D> + Send + Sync + 'static, S: Storage<D> + Send + Sync + 'static,
<S as Storage<D>>::Error: Send, <S as Storage<D>>::Error: Send,
@ -51,7 +51,7 @@ where
})) }))
} }
fn add_dialogue<Upd, S, D>(self) -> Self fn enter_dialogue<Upd, S, D>(self) -> Self
where where
S: Storage<D> + Send + Sync + 'static, S: Storage<D> + Send + Sync + 'static,
<S as Storage<D>>::Error: Send, <S as Storage<D>>::Error: Send,