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.
filter_boost_addedandfilter_reply_to_storyfilters to theMessageFilterExttrait (PR 1131)filter_mention_commandfilter to theHandlerExttrait (issue 494)filter_business_connection,filter_business_message,filter_edited_business_message, andfilter_deleted_business_messagesfilters to theUpdateFilterExttrait (PR 1146)- Syntax sugar for making requests (issue 1143):
bot.forward,bot.edit_live_location,bot.stop_live_location,bot.set_reaction,bot.pin,bot.unpin,bot.edit_text,bot.edit_caption,bot.edit_media,bot.edit_reply_markup,bot.stop_poll_message,bot.deleteandbot.copymethods to the newcrate::sugar::bot::BotMessagesExttraitreq.reply_tomethod to the newcrate::sugar::request::RequestReplyExttraitreq.disable_link_previewmethod to the newcrate::sugar::request::RequestLinkPreviewExttrait
stack_sizesetter toDispatcherBuilder(PR 1185)utils::rendermodule to render HTML/Markdown-formatted output (PR 1152)Bot::from_envnow can read and useTELOXIDE_API_URLenvironmental variable (PR 1197)
- Environment bumps: (PR 1147)
- MSRV (Minimal Supported Rust Version) was bumped from
1.70.0to1.80.0 - Some dependencies was bumped:
sqlxto0.8.1,towerto0.5.0,reqwestto0.12.7 tokioversion was explicitly specified as1.39
- MSRV (Minimal Supported Rust Version) was bumped from
- Added new
SendandSynctrait bounds to theUListenerandEhgeneric parameters oftry_dispatch_with_listeneranddispatch_with_listener(PR 1185) [BC]
- Now Vec in requests serializes into [number] instead of [ {message_id: number} ],
forward_messages,copy_messagesanddelete_messagesnow work properly - Now
InlineQueryResultsButtonserializes properly (issue 1181) - Now
ThreadIdis able to serialize in multipart requests (PR 1179) - Now stack does not overflow on dispatch (issue 1154)
- Documentation regarding the way captions work for the official clients on
SendMediaGroup(PR 992) - Add
MessageToCopyNotFounderror toteloxide::errors::ApiError(PR 917) Dispatcher::try_dispatch_with_listener(PR 913)- Missing Message::filter_* functions (PR 982):
filter_gamefilter_venuefilter_videofilter_video_notefilter_voicefilter_migrationfilter_migration_fromfilter_migration_tofilter_new_chat_titlefilter_new_chat_photofilter_delete_chat_photofilter_group_chat_createdfilter_supergroup_chat_createdfilter_channel_chat_createdfilter_message_auto_delete_timer_changedfilter_invoicefilter_successful_paymentfilter_connected_websitefilter_write_access_allowedfilter_passport_datafilter_proximity_alert_triggeredfilter_forum_topic_createdfilter_forum_topic_editedfilter_forum_topic_closedfilter_forum_topic_reopenedfilter_general_forum_topic_hiddenfilter_general_forum_topic_unhiddenfilter_video_chat_scheduledfilter_video_chat_startedfilter_video_chat_endedfilter_video_chat_participants_invitedfilter_web_app_data
- Implement
PostgresStorage, a persistent dialogue storage based on PostgreSQL(PR 996). - Implement
GetChatIdforteloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated}. - Use deadpool-redis for Redis connection pooling (PR 1081).
- Add
MessageExt::filter_storymethod for the correspondingMediaKind::Storyvariant (PR 1087). - Add
update_listeners::webhooks::Options::path, an option to make the webhook server listen on a different path, which can be useful behind a reverse proxy. - Add
filter_giveaway,filter_giveaway_completed,filter_giveaway_createdandfilter_giveaway_winnersfilters toMessageFilterExttrait (PR 1101)
- Use
UserIdinstead ofi64foruser_idinhtml::user_mentionandmarkdown::user_mention(PR 896) - Greatly improved the speed of graceful shutdown (
^C) (PR 938) - Fix typos in documentation (PR 953)
- Use
Secondsinstead ofStringinInlineQueryResultAudioforaudio_duration(PR 994) - High CPU usage on network errors (PR 1002, Issue 780)
- Fix app build errors when using items gated behind sqlite-storage with the feature sqlite-storage-rustls (PR 1018)
- Fix typo in
ApiError::ToMuchMessagesvariant (rename it toTooMuchMessages) (PR 1046) - Fix
ChatPermissionbehavior to accurately reflect Telegram's functionality (PR 1068)
- MSRV (Minimal Supported Rust Version) was bumped from
1.64.0to1.68.0([PR 950][teloxide#950]) - Sqlx version was bumped from
0.6to0.7.3(PR 995) - Feature
sqlite-storagewas renamed tosqlite-storage-nativetls(PR 995) - MSRV (Minimal Supported Rust Version) was bumped from
1.68.0to1.70.0([PR 996][teloxide#996]) axumwas bumped to0.7, along with related libraries used for webhooks ([PR 1093][teloxide#1093])Polling's exponential backoff now results in 64 seconds maximum delay instead of 17 minutes ([PR 1113][teloxide#1113])filter_forward_fromwas renamed tofilter_forward_originand now returnsMessageOrigininstead ofForwardFrom(PR 1101)
UpdateListener::timeout_hintand related APIs (PR 938)
docs.rsdocumentation build
- Allow
ChatJoinRequestupdates - Some example links in documentation
Update::filter_chat_join_requestsqlite-storage-rustlsfeature, that allows using sqlite storage withoutnative-tls
- Updated
teloxide-coreto v0.9.1; see its changelog for more
- Updated
teloxide-macrosto v0.7.1; see its changelog for more. - Updated
teloxide-coreto v0.9.0; see its changelog for more. - Updated
axumto v0.6.0. - The module structure
teloxide::dispatching::update_listeners=>teloxide::update_listenersteloxide::dispatching::repls=>teloxide::repls
CommandDescriptions::newwas madeconst- The following functions were made
#[must_use]:DispatcherBuilder::{enable_ctrlc_handler, distribution_function}
rocksdb-storagefeature and associated items (See PR #761 for reasoning) [BC]
teloxide::dispatching::{update_listeners, repls}(see in the "Changed" section)
- Add another missing feature gate for
dispatching::replsimport (issue #770)
- Add missing feature gate for
dispatching::replsimport (issue #770)
This release was yanked because it accidentally breaks backwards compatibility.
- The
rocksdb-storagefeature -- enables the RocksDB support (PR #753) teloxide::dispatching::repls::CommandReplExt,teloxide::prelude::CommandReplExt(issue #740)
teloxide::dispatching::repls::{commands_repl, commands_repl_with_listener},teloxide::utils::command::BotCommands::ty(useCommandReplExtinstead)
- Updated
teloxide-macrosto v0.7.0; see its changelog for more - Updated
teloxide-coreto v0.8.0; see its changelog for more UpdateListenernow has an associated typeErrinstead of a genericAsUpdateStreamnow has an associated typeStreamErrinstead of a generic- Rename
dispatching::stop_token::{AsyncStopToken, AsyncStopFlag}=>stop::{StopToken, StopFlag} - Replace the generic error type
EwithRequestErrorfor REPLs (repl(_with_listener),commands_repl(_with_listener)) - The following functions are now
#[must_use]:BotCommands::ty.CommandDescriptions::{new, global_description, username, username_from_me}.teloxide::filter_command.teloxide::dispatching::dialogue::enter.
BotCommands::parsenow acceptbot_usernameas&str
requests::ResponseResulttoprelude
dispatching::stop_token::StopTokentrait (all uses are replaced withstop::StopTokenstructure)- Some previously deprecated items
enable_logging!,enable_logging_with_filter!HandlerFactory,HandlerExt::dispatch_by
- Mark the following functions with
#[must_use](PR 457):TraceStorage::into_inner.AsyncStopToken::new_pair.AsyncStopFlag::is_stopped.- All from
crate::utils::{html, markdown}.
- Rendering of GIFs in lib.rs and crates.io (PR 681).
- Security checks based on
secret_tokenparam ofset_webhookto built-in webhooks. dispatching::update_listeners::{PollingBuilder, Polling, PollingStream}.DispatcherBuilder::enable_ctrlc_handlermethod.
Dispatcherno longer "leaks" memory for every inactive user (PR 657).- Allow specifying a path to a custom command parser in
parse_with(issue 668).
- Add the
Key: Clonerequirement forimpl Dispatcher[BC]. dispatching::update_listeners::{polling_default, polling}now return a named,Polling<_>type.- Update
teloxide-coreto v0.7.0 with Bot API 6.1 support, see its changelog for more information [BC].
- The
dispatching::update_listeners::pollingfunction. Dispatcher::setup_ctrlc_handlermethod.
- Fix Api Unknown error (Can't parse entities) on message created with
utils::markdown::user_mention_or_linkif user full name contains some escapable symbols eg '.'
- Fix
#[command(rename = "...")]for custom command names (issue 633).
- The
dispatching::filter_commandfunction (also accessible asteloxide::filter_command) as a shortcut fordptree::entry().filter_command(). - Re-export
dptree::case!asteloxide::handler!(the former is preferred for new code).
- Update
teloxide-coreto v0.6.0 with Bot API 6.0 support [BC].
- Fix the broken
#[derive(DialogueState)](function return typedptree::Handler).
- Implement
GetChatIdforUpdate. - The
dialogue::enter()function as a shortcut fordptree::entry().enter_dialogue().
- The old dispatching system and related stuff:
dispatching,utils::UpState,prelude,repls2,crate::{dialogues_repl, dialogues_repl_with_listener}, and#[teloxide(subtransition)][BC].
- The new API for dialogue handlers:
teloxide::handler!(issue 567). - Built-in webhooks support via
teloxide::dispatching::update_listeners::webhooksmodule. Dialogue::chat_idfor retrieving a chat ID from a dialogue.
- Updated
teloxide-corefrom version0.4.5to version0.5.0[BC] - Rename
dispatching2=>dispatching[BC]. - Rename
prelude2=>prelude[BC]. - Move
update_listeners,stop_token,IdleShutdownError, andShutdownTokenfrom the olddispatchingto the newdispatching(previouslydispatching2). - Replace
crate::{commands_repl, commands_repl_with_listener, repl, repl_with_listener}with those of the newdispatching[BC]. UpdateListener::StopTokenis now alwaysSend[BC].- Rename
BotCommandtrait toBotCommands[BC]. BotCommands::descriptionsnow returnsCommandDescriptionsinstead ofString[BC].- Mark
Dialogue::newas#[must_use].
- Concurrent update handling in the new dispatcher (issue 536).
HandlerFactoryandHandlerExt::dispatch_byin favour ofteloxide::handler!.
- Update
teloxide-coreto version0.4.5to fix a security vulnerability. See more inteloxide-corerelease notes.
- The
Storage::erasedefault function that returnsArc<ErasedStorage>. ErasedStorage, a storage with an erased error type.- Allow the storage generic
Sbe?SizedinDialogueandHandlerExt::enter_dialogue.
enable_logging!andenable_logging_with_filter!macros
- Log
UpdateKind::Errorinteloxide::dispatching2::Dispatcher. - Don't warn about unhandled updates in
repls2(issue 557). parse_commandandparse_command_with_prefixnow ignores case of the bot username
- Compilation with non-default features
Dispatcherwasn'tSend. MakeDispatcherBuilder::{default_handler, error_handler}accept a handler that implementsSend + Sync(PR 517).
- docs.rs documentation build
BotCommand::bot_commandsto obtain Telegram API commands (issue 262).- The
dispatching2andprelude2modules. They present a new dispatching model based ondptree.
- Require that
AsUpdateStream::StreamisSend. - Restrict a user crate by
CARGO_CRATE_NAMEinstead ofCARGO_PKG_NAMEinenable_logging!andenable_logging_with_filter!. - Updated
teloxide-coreto v0.4.0, see its changelog.
- The
dispatchingandpreludemodules.
- Infinite retries while stopping polling listener (issue 496)
polling{,_default}and it'sStreamandStopTokennot beingSend(and by extension fix the same problem withrepls)
- Compilation when the
ctrlc_handlerfeature is disabled (issue 462)
- Depend on a correct
futuresversion (v0.3.15).
- Improved log messages when
^Cis received with^Chandler set up
Storage::get_dialogueto obtain a dialogue indexed by a chat ID.InMemStorageErrorwith a single variantDialogueNotFoundto be returned fromInMemStorage::remove_dialogue.RedisStorageError::DialogueNotFoundandSqliteStorageError::DialogueNotFoundto be returned fromStorage::remove_dialogue.- A way to
shutdowndispatcherDispatcher::shutdown_tokenfunction.ShutdownTokenwith ashutdownfunction.
Dispatcher::setup_ctrlc_handlerfunction (issue 153).IdleShutdownError- Automatic update filtering (issue 389).
- Added reply shortcut to every kind of messages (PR 404).
- Do not return a dialogue from
Storage::{remove_dialogue, update_dialogue}. - Return an error from
Storage::remove_dialogueif a dialogue does not exist. - Require
D: Cloneindialogues_repl(_with_listener)andInMemStorage. - Automatically delete a webhook if it was set up in
update_listeners::polling_default(thereby making itasync, issue 319). pollingandpolling_defaultnow requireR: 'static- Refactor
UpdateListenertrait:- Add a
StopTokenassociated type.- It must implement a new
StopTokentrait which has the only functionfn stop(self);
- It must implement a new
- Add a
stop_tokenfunction that returnsSelf::StopTokenand allows stopping the listener later (issue 166). - Remove blanked implementation.
- Remove
Streamfrom super traits. - Add
AsUpdateStreamto super traits.- Add an
AsUpdateStreamtrait that allows turning implementors into streams of updates (GAT workaround).
- Add an
- Add a
timeout_hintfunction (with a default implementation).
- Add a
Dispatcher::dispatchandDispatcher::dispatch_with_listenernow require mutable reference to self.- Repls can now be stopped by
^Csignal. NoopandAsyncStopTokenstop tokens.StatefulListener.- Emit not only errors but also warnings and general information from teloxide, when set up by
enable_logging!. - Use
i64instead ofi32foruser_idinhtml::user_mentionandmarkdown::user_mention. - Updated to
teloxide-corev0.3.0(see it's changelog for more)
- Remove the
reqwestdependency. It's not needed after the teloxide-core integration. - A storage persistence bug (issue 304).
- Log errors from
Storage::{remove_dialogue, update_dialogue}inDialogueDispatcher(issue 302). - Mark all the functions of
Storageas#[must_use].
- Integrate teloxide-core.
- Allow arbitrary error types to be returned from (sub)transitions (issue 242).
- The
respondfunction, a shortcut forResponseResult::Ok(()). - The
sqlite-storagefeature -- enables SQLite support. Dispatcher::{my_chat_members_handler, chat_members_handler}
UpdateWithCx::answer_str
- Hide
SubtransitionOutputTypefrom the docs.
- Export
teloxide_macros::teloxideinprelude. dispatching::dialogue::serializer::{JSON -> Json, CBOR -> Cbor}- Allow
bot_namebeN, 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_mediaandedit_message_reply_markup) are split into common and inline versions (e.g.:edit_message_textandedit_inline_message_text). Instead ofChatOrInlineMessagecommon versions acceptchat_id: impl Into<ChatId>andmessage_id: i32whereas inline versions acceptinline_message_id: impl Into<String>. Also note that return type of inline versions isTrue(issue 253, pr 257) ChatOrInlineMessageis renamed toTargetMessage, it's::Chatvariant is renamed to::Common,#[non_exhaustive]annotation is removed from the enum, type ofTargetMessage::Inline::inline_message_idchangedi32=>String.TargetMessagenow implementsFrom<String>,get_game_high_scoresandset_game_scoreuseInto<TargetMessage>to acceptStrings. (issue 253, pr 257)- Remove
ResponseResultfromprelude.
- Failing compilation with
serde::export(issue 328).
- The
dicefield fromMessageDiceis public now (issue 306)
LoginUrl::new(issue 298)
Bot::buildermethod (PR 269).
- Support for typed bot commands (issue 152).
BotBuilder, which allows setting a defaultParseMode.- The
Transition,Subtransition,SubtransitionOutputTypetraits. - A nicer approach to manage dialogues via
#[derive(Transition)]+#[teloxide(subtransition)](seeexamples/dialogue_bot). - The
redis-storagefeature -- enables the Redis support. - The
cbor-serializerfeature -- enables theCBORserializer for dialogues. - The
bincode-serializerfeature -- enables theBincodeserializer for dialogues. - The
frunkfeature -- enablesteloxide::utils::UpState, which allows mapping from a structure offield1, ..., fieldNto a structure offield1, ..., fieldN, fieldN+1. - Upgrade to v4.9 Telegram bots API.
teloxide::utils::client_from_env-- constructs a client from theTELOXIDE_TOKENenvironmental variable.- Import
Transition,TransitionIn,TransitionOut,UpStatetoteloxide::prelude. - Import
repl,commands_repltoteloxide. - 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. TheSerializertrait,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_PROXYenvironment variable inBot::from_env.
Bot::{from_env_with_client, new, with_client}
DialogueDispatcherHandlerCx->DialogueWithCx.DispatcherHandlerCx->UpdateWithCx.- Now provided description of unknown telegram error, by splitting ApiErrorKind at
ApiErrorKindandApiErrorKindKnownenums (issue 199). - Extract
BotfromArc(issue 216). - Mark all the API types as
#[non_exhaustive]. - Replace all
mime_type: StringwithMimeWrapper.
- Now methods which can send file to Telegram return
tokio::io::Result<T>. Before that it could panic (issue 216). - If a bot wasn't triggered for several days, it stops responding (issue 223).
- The functionality to parse commands only with a correct bot's name (breaks backwards compatibility) (Issue 168).
- This
CHANGELOG.md.
- Fix parsing a pinned message (Issue 167).
- Replace
LanguageCodewithString, because the official Telegram documentation doesn't specify a concrete version of IETF language tag. - Problems with the
poll_typefield (Issue 178). - Make
polling_defaultactually a long polling update listener (PR 182).
- either from the dependencies in
Cargo.toml. teloxide-macrosmigrated into the separate repository to easier releases and testing.
- This project.