2020-02-25 03:04:24 +06:00
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog ](https://keepachangelog.com/en/1.0.0/ ),
and this project adheres to [Semantic Versioning ](https://semver.org/spec/v2.0.0.html ).
2021-08-31 18:38:21 +03:00
## unreleased
2020-10-23 09:02:00 +06:00
2022-07-01 23:36:39 +04:00
### Added
- Security checks based on `secret_token` param of `set_webhook` to built-in webhooks
2022-06-27 00:02:27 +04:00
### Fixed
2022-06-27 02:30:39 +06:00
- `Dispatcher` no longer "leaks" memory for every inactive user ([PR 657 ](https://github.com/teloxide/teloxide/pull/657 )).
### Changed
- Add the `Key: Clone` requirement for `impl Dispatcher` [**BC**].
2022-06-27 00:02:27 +04:00
2022-06-07 10:06:37 +06:00
## 0.9.2 - 2022-06-07
2022-06-05 09:50:12 +03:00
### Fixed
- Fix Api Unknown error (Can't parse entities) on message created with `utils::markdown::user_mention_or_link` if user full name contaiins some escapable symbols eg '.'
2022-05-27 00:27:57 +06:00
## 0.9.1 - 2022-05-27
2022-05-26 23:53:01 +06:00
### Fixed
- Fix `#[command(rename = "...")]` for custom command names ([issue 633 ](https://github.com/teloxide/teloxide/issues/633 )).
2022-04-27 16:10:33 +06:00
## 0.9.0 - 2022-04-27
2022-04-25 19:16:05 +06:00
### Added
- The `dispatching::filter_command` function (also accessible as `teloxide::filter_command` ) as a shortcut for `dptree::entry().filter_command()` .
2022-04-27 15:31:17 +06:00
- Re-export `dptree::case!` as `teloxide::handler!` (the former is preferred for new code).
2022-04-25 19:16:05 +06:00
2022-04-25 18:44:27 +06:00
### Changed
- Update teloxide-core to v0.6.0 with [Bot API 6.0] support [**BC**].
[Bot API 6.0]: https://core.telegram.org/bots/api#april -16-2022
2022-04-26 02:25:50 +06:00
## 0.8.2 - 2022-04-26
2022-04-26 01:55:29 +06:00
### Fixed
- Fix the broken `#[derive(DialogueState)]` (function return type `dptree::Handler` ).
2022-04-24 01:34:53 +06:00
## 0.8.1 - 2022-04-24
2022-04-22 23:42:39 +06:00
### Added
- Implement `GetChatId` for `Update` .
2022-04-23 00:11:27 +06:00
- The `dialogue::enter()` function as a shortcut for `dptree::entry().enter_dialogue()` .
2022-04-22 23:42:39 +06:00
2022-04-18 16:32:46 +06:00
## 0.8.0 - 2022-04-18
2022-03-24 17:25:42 +06:00
### Removed
2022-03-26 14:59:51 +06:00
2022-03-24 17:41:19 +06:00
- The old dispatching system and related stuff: `dispatching` , `utils::UpState` , `prelude` , `repls2` , `crate::{dialogues_repl, dialogues_repl_with_listener}` , and `#[teloxide(subtransition)]` [**BC**].
2022-03-26 14:59:51 +06:00
2022-04-02 21:32:59 +06:00
### Added
2022-03-24 17:25:42 +06:00
2022-04-02 21:32:59 +06:00
- The new API for dialogue handlers: `teloxide::handler!` ([issue 567 ](https://github.com/teloxide/teloxide/issues/567 )).
2022-04-07 18:37:53 +06:00
- Built-in webhooks support via `teloxide::dispatching::update_listeners::webhooks` module.
- `Dialogue::chat_id` for retrieving a chat ID from a dialogue.
2022-03-24 17:25:42 +06:00
### Changed
2022-04-13 15:56:54 +04:00
- Updated `teloxide-core` from version `0.4.5` to version [`0.5.0` ](https://github.com/teloxide/teloxide-core/releases/tag/v0.5.0 ) [**BC**]
2022-03-24 17:25:42 +06:00
- Rename `dispatching2` => `dispatching` [**BC**].
- Rename `prelude2` => `prelude` [**BC**].
- Move `update_listeners` , `stop_token` , `IdleShutdownError` , and `ShutdownToken` from the old `dispatching` to the new `dispatching` (previously `dispatching2` ).
- Replace `crate::{commands_repl, commands_repl_with_listener, repl, repl_with_listener}` with those of the new `dispatching` [**BC**].
- `UpdateListener::StopToken` is now always `Send` [**BC**].
- Rename `BotCommand` trait to `BotCommands` [**BC**].
- `BotCommands::descriptions` now returns `CommandDescriptions` instead of `String` [**BC**].
2022-04-08 00:03:27 +06:00
- Mark `Dialogue::new` as `#[must_use]` .
2022-03-24 17:25:42 +06:00
2022-04-13 02:45:02 +06:00
### Fixed
- Concurrent update handling in the new dispatcher ([issue 536 ](https://github.com/teloxide/teloxide/issues/536 )).
2022-04-08 00:18:13 +06:00
### Deprecated
- `HandlerFactory` and `HandlerExt::dispatch_by` in favour of `teloxide::handler!` .
2022-04-03 16:19:17 +04:00
## 0.7.3 - 2022-04-03
### Fixed
- Update `teloxide-core` to version `0.4.5` to fix a security vulnerability. See more in `teloxide-core` [release notes ](https://github.com/teloxide/teloxide-core/releases/tag/v0.4.5 ).
2022-03-23 10:47:56 +04:00
## 0.7.2 - 2022-03-23
2022-03-22 11:40:53 +06:00
2022-03-20 09:06:21 +06:00
### Added
2022-03-21 20:06:32 +06:00
- The `Storage::erase` default function that returns `Arc<ErasedStorage>` .
2022-03-20 09:06:21 +06:00
- `ErasedStorage` , a storage with an erased error type.
2022-03-21 20:09:06 +06:00
- Allow the storage generic `S` be `?Sized` in `Dialogue` and `HandlerExt::enter_dialogue` .
2022-03-20 09:06:21 +06:00
2022-03-21 18:53:59 +04:00
### Deprecated
2022-03-21 19:31:44 +04:00
- `enable_logging!` and `enable_logging_with_filter!` macros
2022-03-21 18:53:59 +04:00
2022-03-21 20:40:04 +06:00
### Fixed
- Log `UpdateKind::Error` in `teloxide::dispatching2::Dispatcher` .
2022-03-21 21:11:46 +06:00
- Don't warn about unhandled updates in `repls2` ([issue 557 ](https://github.com/teloxide/teloxide/issues/557 )).
2022-03-14 22:22:00 +04:00
- `parse_command` and `parse_command_with_prefix` now ignores case of the bot username
2022-03-21 20:40:04 +06:00
2022-03-09 20:42:12 +06:00
## 0.7.1 - 2022-03-09
2022-03-08 12:20:01 +04:00
### Fixed
- Compilation with non-default features
2022-02-09 08:36:25 +06:00
## 0.7.0 - 2022-02-09
2022-02-09 17:06:17 +06:00
### Fixed
2022-02-07 15:58:34 +06:00
2022-02-09 17:06:17 +06:00
- `Dispatcher` wasn't `Send` . Make `DispatcherBuilder::{default_handler, error_handler}` accept a handler that implements `Send + Sync` ([PR 517 ](https://github.com/teloxide/teloxide/pull/517 )).
2022-02-07 15:58:34 +06:00
2022-02-06 17:23:21 +03:00
## 0.6.1 - 2022-02-06
### Fixed
- docs.rs documentation build
2022-02-06 18:33:01 +06:00
## 0.6.0 - 2022-02-06
2022-02-06 17:47:56 +06:00
2022-02-05 02:18:47 +06:00
### Added
- `BotCommand::bot_commands` to obtain Telegram API commands ([issue 262 ](https://github.com/teloxide/teloxide/issues/262 )).
2022-02-05 13:50:46 +06:00
- The `dispatching2` and `prelude2` modules. They presents a new dispatching model based on `dptree` .
2022-02-05 02:18:47 +06:00
2021-09-04 14:02:56 +03:00
### Changed
2022-02-05 13:50:46 +06:00
- Require that `AsUpdateStream::Stream` is `Send` .
2022-02-05 01:07:28 +06:00
- Restrict a user crate by `CARGO_CRATE_NAME` instead of `CARGO_PKG_NAME` in `enable_logging!` and `enable_logging_with_filter!` .
2022-02-06 17:32:30 +06:00
- Updated `teloxide-core` to v0.4.0, see [its changelog ](https://github.com/teloxide/teloxide-core/blob/master/CHANGELOG.md#040---2022-02-03 ).
2020-10-23 09:02:00 +06:00
2022-02-05 13:50:46 +06:00
### Deprecated
- The `dispatching` and `prelude` modules.
2022-01-17 14:42:49 +03:00
### Fixed
- Infinite retries while stopping polling listener ([issue 496 ](https://github.com/teloxide/teloxide/issues/496 ))
2022-01-18 19:27:57 +03:00
- `polling{,_default}` and it's `Stream` and `StopToken` not being `Send` (and by extension fix the same problem with `repl` s)
2022-01-17 14:42:49 +03:00
2021-10-25 20:10:12 +06:00
## 0.5.3 - 2021-10-25
2021-10-25 15:52:57 +03:00
2021-10-23 02:11:45 +03:00
### Fixed
- Compilation when the `ctrlc_handler` feature is disabled ([issue 462 ](https://github.com/teloxide/teloxide/issues/462 ))
2021-08-31 18:38:21 +03:00
## 0.5.2 - 2021-08-25
2021-08-25 23:51:19 +06:00
2021-08-25 18:12:14 +03:00
### Fixed
2021-08-25 23:51:19 +06:00
- Depend on a correct `futures` version (v0.3.15).
2021-08-25 18:12:14 +03:00
2021-08-31 18:38:21 +03:00
## 0.5.1 - 2021-08-05
2021-08-01 20:45:59 +06:00
2021-07-21 15:53:52 +03:00
### Changed
2021-08-01 20:45:59 +06:00
- Improved log messages when `^C` is received with `^C` handler set up
2021-07-21 15:53:52 +03:00
2021-08-31 18:38:21 +03:00
## 0.5.0 - 2021-07-08
2021-07-08 15:22:13 +06:00
2021-03-28 05:34:25 +06:00
### Added
2021-05-08 17:21:24 +06:00
- `Storage::get_dialogue` to obtain a dialogue indexed by a chat ID.
2021-05-08 19:00:38 +06:00
- `InMemStorageError` with a single variant `DialogueNotFound` to be returned from `InMemStorage::remove_dialogue` .
- `RedisStorageError::DialogueNotFound` and `SqliteStorageError::DialogueNotFound` to be returned from `Storage::remove_dialogue` .
2021-06-27 11:04:55 +03:00
- A way to `shutdown` dispatcher
- `Dispatcher::shutdown_token` function.
- `ShutdownToken` with a `shutdown` function.
2021-05-18 18:30:57 +03:00
- `Dispatcher::setup_ctrlc_handler` function ([issue 153 ](https://github.com/teloxide/teloxide/issues/153 )).
2021-06-27 11:04:55 +03:00
- `IdleShutdownError`
2021-06-27 14:29:17 +03:00
- Automatic update filtering ([issue 389 ](https://github.com/teloxide/teloxide/issues/389 )).
2021-06-30 19:47:43 +05:30
- Added reply shortcut to every kind of messages ([PR 404 ](https://github.com/teloxide/teloxide/pull/404 )).
2021-03-28 05:34:25 +06:00
### Changed
- Do not return a dialogue from `Storage::{remove_dialogue, update_dialogue}` .
2021-05-08 17:21:24 +06:00
- Return an error from `Storage::remove_dialogue` if a dialogue does not exist.
2021-03-28 16:30:12 +06:00
- Require `D: Clone` in `dialogues_repl(_with_listener)` and `InMemStorage` .
2021-03-28 08:51:57 +06:00
- Automatically delete a webhook if it was set up in `update_listeners::polling_default` (thereby making it `async` , [issue 319 ](https://github.com/teloxide/teloxide/issues/319 )).
2021-05-18 14:46:45 +03:00
- `polling` and `polling_default` now require `R: 'static`
- Refactor `UpdateListener` trait:
2021-06-27 11:04:55 +03:00
- Add a `StopToken` associated type.
- It must implement a new `StopToken` trait which has the only function `fn stop(self);`
- Add a `stop_token` function that returns `Self::StopToken` and allows stopping the listener later ([issue 166 ](https://github.com/teloxide/teloxide/issues/166 )).
2021-05-18 14:46:45 +03:00
- Remove blanked implementation.
- Remove `Stream` from super traits.
- Add `AsUpdateStream` to super traits.
- Add an `AsUpdateStream` trait that allows turning implementors into streams of updates (GAT workaround).
2021-06-27 11:04:55 +03:00
- Add a `timeout_hint` function (with a default implementation).
- `Dispatcher::dispatch` and `Dispatcher::dispatch_with_listener` now require mutable reference to self.
- Repls can now be stopped by `^C` signal.
- `Noop` and `AsyncStopToken` stop tokens.
- `StatefulListener` .
2021-06-27 15:44:46 +06:00
- Emit not only errors but also warnings and general information from teloxide, when set up by `enable_logging!` .
2021-07-04 10:29:46 +03:00
- Use `i64` instead of `i32` for `user_id` in `html::user_mention` and `markdown::user_mention` .
2021-07-05 21:28:03 +03:00
- Updated to `teloxide-core` `v0.3.0` (see it's [changelog ](https://github.com/teloxide/teloxide-core/blob/master/CHANGELOG.md#030---2021-07-05 ) for more)
2021-03-28 05:34:25 +06:00
### Fixed
2021-03-28 16:37:51 +06:00
- Remove the `reqwest` dependency. It's not needed after the [teloxide-core] integration.
2021-03-28 05:34:25 +06:00
- A storage persistency bug ([issue 304 ](https://github.com/teloxide/teloxide/issues/304 )).
2021-03-28 08:30:05 +06:00
- Log errors from `Storage::{remove_dialogue, update_dialogue}` in `DialogueDispatcher` ([issue 302 ](https://github.com/teloxide/teloxide/issues/302 )).
2021-04-03 06:53:02 +06:00
- Mark all the functions of `Storage` as `#[must_use]` .
2021-03-28 05:34:25 +06:00
2021-08-31 18:38:21 +03:00
## 0.4.0 - 2021-03-22
2021-03-21 18:34:23 +06:00
2020-10-23 09:02:00 +06:00
### Added
2021-03-06 03:18:03 +06:00
- Integrate [teloxide-core].
2020-10-23 09:02:00 +06:00
- Allow arbitrary error types to be returned from (sub)transitions ([issue 242 ](https://github.com/teloxide/teloxide/issues/242 )).
- The `respond` function, a shortcut for `ResponseResult::Ok(())` .
2020-10-24 20:08:00 +03:00
- The `sqlite-storage` feature -- enables SQLite support.
2021-03-17 23:36:51 +06:00
- `Dispatcher::{my_chat_members_handler, chat_members_handler}`
[teloxide-core]: https://github.com/teloxide/teloxide-core
2020-10-23 09:02:00 +06:00
2021-03-06 03:18:03 +06:00
### Deprecated
- `UpdateWithCx::answer_str`
### Fixed
- Hide `SubtransitionOutputType` from the docs.
2020-10-23 09:02:00 +06:00
### Changed
2021-03-21 18:34:23 +06:00
- Export `teloxide_macros::teloxide` in `prelude` .
- `dispatching::dialogue::serializer::{JSON -> Json, CBOR -> Cbor}`
2020-10-23 09:02:00 +06:00
- Allow `bot_name` be `N` , where `N: Into<String> + ...` in `commands_repl` & `commands_repl_with_listener` .
- 'Edit methods' (namely `edit_message_live_location` , `stop_message_live_location` , `edit_message_text` ,
`edit_message_caption` , `edit_message_media` and `edit_message_reply_markup` ) are split into common and inline
versions (e.g.: `edit_message_text` and `edit_inline_message_text` ). Instead of `ChatOrInlineMessage` common versions
accept `chat_id: impl Into<ChatId>` and `message_id: i32` whereas inline versions accept
`inline_message_id: impl Into<String>` . Also note that return type of inline versions is `True` ([issue 253], [pr 257])
- `ChatOrInlineMessage` is renamed to `TargetMessage` , it's `::Chat` variant is renamed to `::Common` ,
`#[non_exhaustive]` annotation is removed from the enum, type of `TargetMessage::Inline::inline_message_id` changed
`i32` => `String` . `TargetMessage` now implements `From<String>` , `get_game_high_scores` and `set_game_score` use
`Into<TargetMessage>` to accept `String` s. ([issue 253], [pr 257])
2021-03-19 17:58:22 +06:00
- Remove `ResponseResult` from `prelude` .
2020-10-23 09:02:00 +06:00
[issue 253]: https://github.com/teloxide/teloxide/issues/253
[pr 257]: https://github.com/teloxide/teloxide/pull/257
2021-08-31 18:38:21 +03:00
## 0.3.4 - 2020-01-13
2021-01-13 11:31:08 +06:00
### Fixed
- Failing compilation with `serde::export` ([issue 328 ](https://github.com/teloxide/teloxide/issues/328 )).
2021-08-31 18:38:21 +03:00
## 0.3.3 - 2020-10-30
2020-10-30 13:26:04 +06:00
### Fixed
- The `dice` field from `MessageDice` is public now ([issue 306 ](https://github.com/teloxide/teloxide/issues/306 ))
2021-08-31 18:38:21 +03:00
## 0.3.2 - 2020-10-23
2020-10-23 09:02:00 +06:00
### Added
- `LoginUrl::new` ([issue 298 ](https://github.com/teloxide/teloxide/issues/298 ))
2021-08-31 18:38:21 +03:00
## 0.3.1 - 2020-08-25
2020-08-21 14:35:14 +03:00
### Added
- `Bot::builder` method ([PR 269 ](https://github.com/teloxide/teloxide/pull/269 )).
2021-08-31 18:38:21 +03:00
## 0.3.0 - 2020-07-31
2020-07-16 19:52:40 +06:00
### Added
2020-07-30 18:18:45 +06:00
- Support for typed bot commands ([issue 152 ](https://github.com/teloxide/teloxide/issues/152 )).
2020-07-16 19:52:40 +06:00
- `BotBuilder` , which allows setting a default `ParseMode` .
2020-07-27 00:48:19 +06:00
- The `Transition` , `Subtransition` , `SubtransitionOutputType` traits.
2020-07-27 00:56:59 +06:00
- A nicer approach to manage dialogues via `#[derive(Transition)]` + `#[teloxide(subtransition)]` (see [`examples/dialogue_bot` ](https://github.com/teloxide/teloxide/tree/af2aa218e7bfc442ab4475023a1c661834f576fc/examples/dialogue_bot )).
2020-07-30 18:18:45 +06:00
- The `redis-storage` feature -- enables the Redis support.
- The `cbor-serializer` feature -- enables the `CBOR` serializer for dialogues.
- The `bincode-serializer` feature -- enables the `Bincode` serializer for dialogues.
- The `frunk` feature -- enables `teloxide::utils::UpState` , which allows mapping from a structure of `field1, ..., fieldN` to a structure of `field1, ..., fieldN, fieldN+1` .
- Upgrade to v4.9 Telegram bots API.
- `teloxide::utils::client_from_env` -- constructs a client from the `TELOXIDE_TOKEN` environmental variable.
2020-07-30 19:25:56 +06:00
- Import `Transition` , `TransitionIn` , `TransitionOut` , `UpState` to `teloxide::prelude` .
2020-07-30 20:22:31 +06:00
- Import `repl` , `commands_repl` to `teloxide` .
2020-07-30 18:18:45 +06:00
- Let users inspect an unknown API error using `ApiErrorKind::Unknown(String)` . All the known API errors are placed into `KnownApiErrorKind` .
- Setters to all the API types.
- `teloxide::dispatching::dialogue::serializer` -- various serializers for memory storages. The `Serializer` trait, `Bincode` , `CBOR` , `JSON` .
2020-07-31 18:48:15 +06:00
- `teloxide::{repl, repl_with_listener, commands_repl, commands_repl_with_listener, dialogues_repl, dialogues_repl_with_listener}`
2020-07-31 20:22:39 +06:00
- `InputFile::Memory`
- Option to hide a command from description ([issue 217 ](https://github.com/teloxide/teloxide/issues/217 )).
2020-07-31 21:34:48 +06:00
- Respect the `TELOXIDE_PROXY` environment variable in `Bot::from_env` .
2020-07-16 19:52:40 +06:00
### Deprecated
2020-07-30 18:18:45 +06:00
- `Bot::{from_env_with_client, new, with_client}`
2020-07-16 19:52:40 +06:00
2020-07-04 17:50:20 +03:00
### Changed
2020-07-30 18:18:45 +06:00
- `DialogueDispatcherHandlerCx` -> `DialogueWithCx` .
- `DispatcherHandlerCx` -> `UpdateWithCx` .
- Now provided description of unknown telegram error, by splitting ApiErrorKind at `ApiErrorKind` and `ApiErrorKindKnown` enums ([issue 199 ](https://github.com/teloxide/teloxide/issues/199 )).
2020-07-17 16:04:25 +06:00
- Extract `Bot` from `Arc` ([issue 216 ](https://github.com/teloxide/teloxide/issues/230 )).
2020-07-30 18:18:45 +06:00
- Mark all the API types as `#[non_exhaustive]` .
2020-07-31 20:22:39 +06:00
- Replace all `mime_type: String` with `MimeWrapper` .
2020-07-30 18:18:45 +06:00
### Fixed
2020-07-30 18:19:45 +06:00
- Now methods which can send file to Telegram returns `tokio::io::Result<T>` . Early its could panic ([issue 216 ](https://github.com/teloxide/teloxide/issues/216 )).
- If a bot wasn't triggered for several days, it stops responding ([issue 223 ](https://github.com/teloxide/teloxide/issues/223 )).
2020-07-17 16:04:25 +06:00
2021-08-31 18:38:21 +03:00
## 0.2.0 - 2020-02-25
2020-02-25 03:04:24 +06:00
### Added
2020-03-27 18:56:32 +06:00
- The functionality to parse commands only with a correct bot's name (breaks backwards compatibility) ([Issue 168 ](https://github.com/teloxide/teloxide/issues/168 )).
2020-02-25 03:04:24 +06:00
- This `CHANGELOG.md` .
### Fixed
2020-03-27 18:56:32 +06:00
- Fix parsing a pinned message ([Issue 167 ](https://github.com/teloxide/teloxide/issues/167 )).
- Replace `LanguageCode` with `String` , because [the official Telegram documentation ](https://core.telegram.org/bots/api#getchat ) doesn't specify a concrete version of IETF language tag.
- Problems with the `poll_type` field ([Issue 178 ](https://github.com/teloxide/teloxide/issues/178 )).
- Make `polling_default` actually a long polling update listener ([PR 182 ](https://github.com/teloxide/teloxide/pull/182 )).
2020-02-25 03:04:24 +06:00
### Removed
- [either ](https://crates.io/crates/either ) from the dependencies in `Cargo.toml` .
- `teloxide-macros` migrated into [the separate repository ](https://github.com/teloxide/teloxide-macros ) to easier releases and testing.
2021-08-31 18:38:21 +03:00
## 0.1.0 - 2020-02-19
2020-02-25 03:04:24 +06:00
### Added
- This project.