mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
a4c147538b
Deprecate `enable_logging!` in favour of configuring logging yourself
11 KiB
11 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
unreleased
Added
- The
Storage::erase
default function that returnsArc<ErasedStorage>
. ErasedStorage
, a storage with an erased error type.- Allow the storage generic
S
be?Sized
inDialogue
andHandlerExt::enter_dialogue
.
Deprecated
enable_logging!
andenable_logging_with_filter!
macros
Fixed
- Log
UpdateKind::Error
inteloxide::dispatching2::Dispatcher
. - Don't warn about unhandled updates in
repls2
(issue 557).
0.7.1 - 2022-03-09
Fixed
- Compilation with non-default features
0.7.0 - 2022-02-09
Fixed
Dispatcher
wasn'tSend
. MakeDispatcherBuilder::{default_handler, error_handler}
accept a handler that implementsSend + Sync
(PR 517).
0.6.1 - 2022-02-06
Fixed
- docs.rs documentation build
0.6.0 - 2022-02-06
Added
BotCommand::bot_commands
to obtain Telegram API commands (issue 262).- The
dispatching2
andprelude2
modules. They presents a new dispatching model based ondptree
.
Changed
- Require that
AsUpdateStream::Stream
isSend
. - Restrict a user crate by
CARGO_CRATE_NAME
instead ofCARGO_PKG_NAME
inenable_logging!
andenable_logging_with_filter!
. - Updated
teloxide-core
to v0.4.0, see its changelog.
Deprecated
- The
dispatching
andprelude
modules.
Fixed
- Infinite retries while stopping polling listener (issue 496)
polling{,_default}
and it'sStream
andStopToken
not beingSend
(and by extension fix the same problem withrepl
s)
0.5.3 - 2021-10-25
Fixed
- Compilation when the
ctrlc_handler
feature is disabled (issue 462)
0.5.2 - 2021-08-25
Fixed
- Depend on a correct
futures
version (v0.3.15).
0.5.1 - 2021-08-05
Changed
- Improved log messages when
^C
is received with^C
handler set up
0.5.0 - 2021-07-08
Added
Storage::get_dialogue
to obtain a dialogue indexed by a chat ID.InMemStorageError
with a single variantDialogueNotFound
to be returned fromInMemStorage::remove_dialogue
.RedisStorageError::DialogueNotFound
andSqliteStorageError::DialogueNotFound
to be returned fromStorage::remove_dialogue
.- A way to
shutdown
dispatcherDispatcher::shutdown_token
function.ShutdownToken
with ashutdown
function.
Dispatcher::setup_ctrlc_handler
function (issue 153).IdleShutdownError
- Automatic update filtering (issue 389).
- Added reply shortcut to every kind of messages (PR 404).
Changed
- Do not return a dialogue from
Storage::{remove_dialogue, update_dialogue}
. - Return an error from
Storage::remove_dialogue
if a dialogue does not exist. - Require
D: Clone
indialogues_repl(_with_listener)
andInMemStorage
. - Automatically delete a webhook if it was set up in
update_listeners::polling_default
(thereby making itasync
, issue 319). polling
andpolling_default
now requireR: 'static
- Refactor
UpdateListener
trait:- Add a
StopToken
associated type.- It must implement a new
StopToken
trait which has the only functionfn stop(self);
- It must implement a new
- Add a
stop_token
function that returnsSelf::StopToken
and allows stopping the listener later (issue 166). - 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).
- Add an
- Add a
timeout_hint
function (with a default implementation).
- Add a
Dispatcher::dispatch
andDispatcher::dispatch_with_listener
now require mutable reference to self.- Repls can now be stopped by
^C
signal. Noop
andAsyncStopToken
stop tokens.StatefulListener
.- Emit not only errors but also warnings and general information from teloxide, when set up by
enable_logging!
. - Use
i64
instead ofi32
foruser_id
inhtml::user_mention
andmarkdown::user_mention
. - Updated to
teloxide-core
v0.3.0
(see it's changelog for more)
Fixed
- Remove the
reqwest
dependency. It's not needed after the teloxide-core integration. - A storage persistency bug (issue 304).
- Log errors from
Storage::{remove_dialogue, update_dialogue}
inDialogueDispatcher
(issue 302). - Mark all the functions of
Storage
as#[must_use]
.
0.4.0 - 2021-03-22
Added
- Integrate teloxide-core.
- Allow arbitrary error types to be returned from (sub)transitions (issue 242).
- The
respond
function, a shortcut forResponseResult::Ok(())
. - The
sqlite-storage
feature -- enables SQLite support. Dispatcher::{my_chat_members_handler, chat_members_handler}
Deprecated
UpdateWithCx::answer_str
Fixed
- Hide
SubtransitionOutputType
from the docs.
Changed
- Export
teloxide_macros::teloxide
inprelude
. dispatching::dialogue::serializer::{JSON -> Json, CBOR -> Cbor}
- Allow
bot_name
beN
, whereN: Into<String> + ...
incommands_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
andedit_message_reply_markup
) are split into common and inline versions (e.g.:edit_message_text
andedit_inline_message_text
). Instead ofChatOrInlineMessage
common versions acceptchat_id: impl Into<ChatId>
andmessage_id: i32
whereas inline versions acceptinline_message_id: impl Into<String>
. Also note that return type of inline versions isTrue
(issue 253, pr 257) ChatOrInlineMessage
is renamed toTargetMessage
, it's::Chat
variant is renamed to::Common
,#[non_exhaustive]
annotation is removed from the enum, type ofTargetMessage::Inline::inline_message_id
changedi32
=>String
.TargetMessage
now implementsFrom<String>
,get_game_high_scores
andset_game_score
useInto<TargetMessage>
to acceptString
s. (issue 253, pr 257)- Remove
ResponseResult
fromprelude
.
0.3.4 - 2020-01-13
Fixed
- Failing compilation with
serde::export
(issue 328).
0.3.3 - 2020-10-30
Fixed
- The
dice
field fromMessageDice
is public now (issue 306)
0.3.2 - 2020-10-23
Added
LoginUrl::new
(issue 298)
0.3.1 - 2020-08-25
Added
Bot::builder
method (PR 269).
0.3.0 - 2020-07-31
Added
- Support for typed bot commands (issue 152).
BotBuilder
, which allows setting a defaultParseMode
.- The
Transition
,Subtransition
,SubtransitionOutputType
traits. - A nicer approach to manage dialogues via
#[derive(Transition)]
+#[teloxide(subtransition)]
(seeexamples/dialogue_bot
). - The
redis-storage
feature -- enables the Redis support. - The
cbor-serializer
feature -- enables theCBOR
serializer for dialogues. - The
bincode-serializer
feature -- enables theBincode
serializer for dialogues. - The
frunk
feature -- enablesteloxide::utils::UpState
, which allows mapping from a structure offield1, ..., fieldN
to a structure offield1, ..., fieldN, fieldN+1
. - Upgrade to v4.9 Telegram bots API.
teloxide::utils::client_from_env
-- constructs a client from theTELOXIDE_TOKEN
environmental variable.- Import
Transition
,TransitionIn
,TransitionOut
,UpState
toteloxide::prelude
. - Import
repl
,commands_repl
toteloxide
. - Let users inspect an unknown API error using
ApiErrorKind::Unknown(String)
. All the known API errors are placed intoKnownApiErrorKind
. - Setters to all the API types.
teloxide::dispatching::dialogue::serializer
-- various serializers for memory storages. TheSerializer
trait,Bincode
,CBOR
,JSON
.teloxide::{repl, repl_with_listener, commands_repl, commands_repl_with_listener, dialogues_repl, dialogues_repl_with_listener}
InputFile::Memory
- Option to hide a command from description (issue 217).
- Respect the
TELOXIDE_PROXY
environment variable inBot::from_env
.
Deprecated
Bot::{from_env_with_client, new, with_client}
Changed
DialogueDispatcherHandlerCx
->DialogueWithCx
.DispatcherHandlerCx
->UpdateWithCx
.- Now provided description of unknown telegram error, by splitting ApiErrorKind at
ApiErrorKind
andApiErrorKindKnown
enums (issue 199). - Extract
Bot
fromArc
(issue 216). - Mark all the API types as
#[non_exhaustive]
. - Replace all
mime_type: String
withMimeWrapper
.
Fixed
- Now methods which can send file to Telegram returns
tokio::io::Result<T>
. Early its could panic (issue 216). - If a bot wasn't triggered for several days, it stops responding (issue 223).
0.2.0 - 2020-02-25
Added
- The functionality to parse commands only with a correct bot's name (breaks backwards compatibility) (Issue 168).
- This
CHANGELOG.md
.
Fixed
- Fix parsing a pinned message (Issue 167).
- Replace
LanguageCode
withString
, because the official Telegram documentation doesn't specify a concrete version of IETF language tag. - Problems with the
poll_type
field (Issue 178). - Make
polling_default
actually a long polling update listener (PR 182).
Removed
- either from the dependencies in
Cargo.toml
. teloxide-macros
migrated into the separate repository to easier releases and testing.
0.1.0 - 2020-02-19
Added
- This project.