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.
- Add
filter_boost_added
andfilter_reply_to_story
filters toMessageFilterExt
trait - Add
filter_mention_command
filter toHandlerExt
trait (issue #494) - Add
filter_business_connection
,filter_business_message
,filter_edited_business_message
, andfilter_deleted_business_messages
filters to update filters (PR 1146)
- Environment bumps: (#1147)
- MSRV (Minimal Supported Rust Version) was bumped from
1.70.0
to1.80.0
- Some dependencies was bumped:
sqlx
to0.8.1
,tower
to0.5.0
,reqwest
to0.12.7
tokio
version was explicitly specified as1.39
- MSRV (Minimal Supported Rust Version) was bumped from
- Now Vec in requests serializes into [number] instead of [ {message_id: number} ],
forward_messages
,copy_messages
anddelete_messages
now work properly
- Documentation regarding the way captions work for the official clients on
SendMediaGroup
(PR 992) - Add
MessageToCopyNotFound
error toteloxide::errors::ApiError
(PR 917) Dispatcher::try_dispatch_with_listener
(PR 913)- Missing Message::filter_* functions (PR 982):
filter_game
filter_venue
filter_video
filter_video_note
filter_voice
filter_migration
filter_migration_from
filter_migration_to
filter_new_chat_title
filter_new_chat_photo
filter_delete_chat_photo
filter_group_chat_created
filter_supergroup_chat_created
filter_channel_chat_created
filter_message_auto_delete_timer_changed
filter_invoice
filter_successful_payment
filter_connected_website
filter_write_access_allowed
filter_passport_data
filter_proximity_alert_triggered
filter_forum_topic_created
filter_forum_topic_edited
filter_forum_topic_closed
filter_forum_topic_reopened
filter_general_forum_topic_hidden
filter_general_forum_topic_unhidden
filter_video_chat_scheduled
filter_video_chat_started
filter_video_chat_ended
filter_video_chat_participants_invited
filter_web_app_data
- Implement
PostgresStorage
, a persistent dialogue storage based on PostgreSQL(PR 996). - Implement
GetChatId
forteloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated}
. - Use deadpool-redis for Redis connection pooling (PR 1081).
- Add
MessageExt::filter_story
method for the correspondingMediaKind::Story
variant (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_created
andfilter_giveaway_winners
filters toMessageFilterExt
trait (PR 1101)
- Use
UserId
instead ofi64
foruser_id
inhtml::user_mention
andmarkdown::user_mention
(PR 896) - Greatly improved the speed of graceful shutdown (
^C
) (PR 938) - Fix typos in documentation (PR 953)
- Use
Seconds
instead ofString
inInlineQueryResultAudio
foraudio_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::ToMuchMessages
variant (rename it toTooMuchMessages
) (PR 1046) - Fix
ChatPermission
behavior to accurately reflect Telegram's functionality (PR 1068)
- MSRV (Minimal Supported Rust Version) was bumped from
1.64.0
to1.68.0
([PR 950][teloxide#950]) - Sqlx version was bumped from
0.6
to0.7.3
(PR 995) - Feature
sqlite-storage
was renamed tosqlite-storage-nativetls
(PR 995) - MSRV (Minimal Supported Rust Version) was bumped from
1.68.0
to1.70.0
([PR 996][teloxide#996]) axum
was 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_from
was renamed tofilter_forward_origin
and now returnsMessageOrigin
instead ofForwardFrom
(PR 1101)
UpdateListener::timeout_hint
and related APIs (PR 938)
docs.rs
documentation build
- Allow
ChatJoinRequest
updates - Some example links in documentation
Update::filter_chat_join_request
sqlite-storage-rustls
feature, that allows using sqlite storage withoutnative-tls
- Updated
teloxide-core
to v0.9.1; see its changelog for more
- Updated
teloxide-macros
to v0.7.1; see its changelog for more. - Updated
teloxide-core
to v0.9.0; see its changelog for more. - Updated
axum
to v0.6.0. - The module structure
teloxide::dispatching::update_listeners
=>teloxide::update_listeners
teloxide::dispatching::repls
=>teloxide::repls
CommandDescriptions::new
was madeconst
- The following functions were made
#[must_use]
:DispatcherBuilder::{enable_ctrlc_handler, distribution_function}
rocksdb-storage
feature 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::repls
import (issue #770)
- Add missing feature gate for
dispatching::repls
import (issue #770)
This release was yanked because it accidentally breaks backwards compatibility.
- The
rocksdb-storage
feature -- 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
(useCommandReplExt
instead)
- Updated
teloxide-macros
to v0.7.0; see its changelog for more - Updated
teloxide-core
to v0.8.0; see its changelog for more UpdateListener
now has an associated typeErr
instead of a genericAsUpdateStream
now has an associated typeStreamErr
instead of a generic- Rename
dispatching::stop_token::{AsyncStopToken, AsyncStopFlag}
=>stop::{StopToken, StopFlag}
- Replace the generic error type
E
withRequestError
for 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::parse
now acceptbot_username
as&str
requests::ResponseResult
toprelude
dispatching::stop_token::StopToken
trait (all uses are replaced withstop::StopToken
structure)- 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_token
param ofset_webhook
to built-in webhooks. dispatching::update_listeners::{PollingBuilder, Polling, PollingStream}
.DispatcherBuilder::enable_ctrlc_handler
method.
Dispatcher
no 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: Clone
requirement forimpl Dispatcher
[BC]. dispatching::update_listeners::{polling_default, polling}
now return a named,Polling<_>
type.- Update
teloxide-core
to v0.7.0 with Bot API 6.1 support, see its changelog for more information [BC].
- The
dispatching::update_listeners::polling
function. Dispatcher::setup_ctrlc_handler
method.
- Fix Api Unknown error (Can't parse entities) on message created with
utils::markdown::user_mention_or_link
if user full name contains some escapable symbols eg '.'
- Fix
#[command(rename = "...")]
for custom command names (issue 633).
- The
dispatching::filter_command
function (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-core
to v0.6.0 with Bot API 6.0 support [BC].
- Fix the broken
#[derive(DialogueState)]
(function return typedptree::Handler
).
- Implement
GetChatId
forUpdate
. - 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::webhooks
module. Dialogue::chat_id
for retrieving a chat ID from a dialogue.
- Updated
teloxide-core
from version0.4.5
to version0.5.0
[BC] - Rename
dispatching2
=>dispatching
[BC]. - Rename
prelude2
=>prelude
[BC]. - Move
update_listeners
,stop_token
,IdleShutdownError
, andShutdownToken
from the olddispatching
to the newdispatching
(previouslydispatching2
). - Replace
crate::{commands_repl, commands_repl_with_listener, repl, repl_with_listener}
with those of the newdispatching
[BC]. UpdateListener::StopToken
is now alwaysSend
[BC].- Rename
BotCommand
trait toBotCommands
[BC]. BotCommands::descriptions
now returnsCommandDescriptions
instead ofString
[BC].- Mark
Dialogue::new
as#[must_use]
.
- Concurrent update handling in the new dispatcher (issue 536).
HandlerFactory
andHandlerExt::dispatch_by
in favour ofteloxide::handler!
.
- Update
teloxide-core
to version0.4.5
to fix a security vulnerability. See more inteloxide-core
release notes.
- 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
.
enable_logging!
andenable_logging_with_filter!
macros
- Log
UpdateKind::Error
inteloxide::dispatching2::Dispatcher
. - Don't warn about unhandled updates in
repls2
(issue 557). parse_command
andparse_command_with_prefix
now ignores case of the bot username
- Compilation with non-default features
Dispatcher
wasn'tSend
. MakeDispatcherBuilder::{default_handler, error_handler}
accept a handler that implementsSend + Sync
(PR 517).
- docs.rs documentation build
BotCommand::bot_commands
to obtain Telegram API commands (issue 262).- The
dispatching2
andprelude2
modules. They present a new dispatching model based ondptree
.
- 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.
- The
dispatching
andprelude
modules.
- 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)
- Compilation when the
ctrlc_handler
feature is disabled (issue 462)
- Depend on a correct
futures
version (v0.3.15).
- Improved log messages when
^C
is received with^C
handler set up
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).
- 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)
- Remove the
reqwest
dependency. 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
Storage
as#[must_use]
.
- 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}
UpdateWithCx::answer_str
- Hide
SubtransitionOutputType
from the docs.
- 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
.
- Failing compilation with
serde::export
(issue 328).
- The
dice
field fromMessageDice
is public now (issue 306)
LoginUrl::new
(issue 298)
Bot::builder
method (PR 269).
- 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
.
Bot::{from_env_with_client, new, with_client}
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
.
- 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
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).
- either from the dependencies in
Cargo.toml
. teloxide-macros
migrated into the separate repository to easier releases and testing.
- This project.