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(
bot,
Update::filter_message()
.add_dialogue::<Message, InMemStorage<State>, State>()
.enter_dialogue::<Message, InMemStorage<State>, State>()
.dispatch_by::<State>(),
)
.dependencies(dptree::deps![InMemStorage::<State>::new()])

View file

@ -49,7 +49,7 @@ async fn main() {
DispatcherBuilder::new(
bot,
Update::filter_message()
.add_dialogue::<Message, InMemStorage<State>, State>()
.enter_dialogue::<Message, InMemStorage<State>, State>()
.dispatch_by::<State>(),
)
.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 handler = Update::filter_message()
.add_dialogue::<Message, RedisStorage<Bincode>, State>()
.enter_dialogue::<Message, RedisStorage<Bincode>, State>()
.dispatch_by::<State>();
DispatcherBuilder::new(bot, handler)

View file

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

View file

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