mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
51 KiB
51 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
-
Support for TBA 7.1 (#1131)
- Updated docs for
can_post_stories
,can_edit_stories
andcan_delete_stories
admin privileges - Add
ChatBoostAdded
andStoryId
structs - Add
ChatBoostAdded
variant toMessageKind
enum - Add
sender_boost_count
andreply_to_story
fields toMessageCommon
struct - Add
chat
andid
fields toStory
struct - Add
unrestrict_boost_count
andcustom_emoji_sticker_set_name
fields toPublicChatSupergroup
struct - Add
boost_added
andreply_to_story
getters toMessage
struct - Add
unrestrict_boost_count
andcustom_emoji_sticker_set_name
getters toChat
struct
- Updated docs for
-
Support for TBA 7.2 (#1146)
- Update documentation of
SendSticker
method - Add
is_from_offline
field toMessageCommon
struct - Add
can_connect_to_business
field toMe
struct - Add
personal_chat
field toChatPrivate
struct - Add
ReplaceStickerInSet
andGetBusinessConnection
methods - Add
Birthdate
struct and corresponding fieldbirthdate
inChatPrivate
- Add
request_name
,request_username
andrequest_photo
fields toKeyboardButtonRequestUsers
struct - Add
request_title
,request_username
andrequest_photo
fields toKeyboardButtonRequestChat
struct - Add
SharedUser
struct - Add
title
,username
andphoto
fields toChatShared
struct - Add
format
field toInputSticker
struct - Add
format
parameter toSetStickerSetThumbnail
method - Add
BusinessConnectionId
struct - Add
business_connection_id
parameter toSendMessage
,SendPhoto
,SendVideo
,SendAnimation
,SendAudio
,SendDocument
,SendSticker
,SendVideoNote
,SendVoice
,SendLocation
,SendVenue
,SendContact
,SendPoll
,SendDice
,SendGame
, andSendMediaGroup
methods - Add
sender_business_bot
andbusiness_connection_id
fields toMessage
struct - Add
BusinessIntro
struct and corresponding fieldbusiness_intro
toChatPrivate
struct - Add
BusinessLocation
struct and corresponding fieldbusiness_location
toChatPrivate
struct - Add
BusinessOpeningHoursInterval
andBusinessOpeningHours
structs and corresponding fieldbusiness_opening_hours
toChatPrivate
struct - Add
BusinessConnection
struct - Add
BusinessMessagesDeleted
struct - Add
BusinessConnection
,BusinessMessage
,EditedBusinessMessage
andDeletedBusinessMessages
variants toUpdateKind
enum
- Update documentation of
-
ApiError::BotKickedFromChannel
(#1157)
Changed
-
MaybeAnonymousUser
type introduced, which replacedPollAnswer::voter: Voter
andMessageReactionUpdated::{user, actor_chat}
inMessageReactionUpdated
(#1134) -
Environment bumps: (#1147)
- MSRV (Minimal Supported Rust Version) was bumped from
1.70.0
to1.80.0
- Some dependencies was bumped:
reqwest
to0.12.7
andron
to0.8.1
tokio
version was explicitly specified as1.39
and featureio-util
was enabled for it
- MSRV (Minimal Supported Rust Version) was bumped from
-
[u8; 3]
sometimes used for RGB values was replaced with dedicatedRgb
struct: (#1151)serde_rgb
module fromtypes.rs
file was removedCreateForumTopic
,ForumTopicCreated
andForumTopic
structs now useRgb
instead of[u8; 3]
foricon_color
field- Added
rgb
crate dependency to Cargo.toml - Added
Rgb
struct withFrom
implementation forRGB8
type from popularrgb
crate
-
Support for TBA 7.2 (#1146)
- Remove
flags
field fromStickerSet
struct - Remove
sticker_format
parameter fromCreateNewStickerSet
method - Wrap
Public
variant ofChatKind
inBox
- Replaced
user_ids
withusers
inUsersShared
struct
- Remove
Removed
Currency
enum removed, its usages replaced withString
.
0.10.1 - 2024-08-17
Fixed
- Issue, when using
ReplyParameters
and multipart-requests involving file-sending it failed withunimplemented error
(#1136, issue #1135)
0.10.0 - 2024-08-16
Added
ChatPermission::can_*
helper functions (#851)mentioned_users
functions forCallbackQuery
,Chat
,ChatJoinRequest
,ChatMemberUpdated
,Game
,Message
,Poll
,Update
which return all containedUser
instances (#850)Message::video_chat_participants_invited
(#850)Update::from
, a replacement forUpdate::user
(#850)Seconds
type, which represents a duration is seconds (#859)VideoChatEnded::duration
field that was previously missed (#859)ThreadId
newtype overMessageId
, used for identifying reply threads (#887)ChatId::as_user
(#905)- Implement
PartialEq<ChatId> for UserId
andPartialEq<UserId> for ChatId
(#905) ChatId::{MIN, MAX}
(#905)- Missing
Message
getters (#982):message_auto_delete_timer_changed
write_access_allowed
forum_topic_created
forum_topic_edited
forum_topic_closed
forum_topic_reopened
general_forum_topic_hidden
general_forum_topic_unhidden
video_chat_scheduled
video_chat_started
video_chat_ended
web_app_data
is_delete_chat_photo
,is_group_chat_created
,is_super_group_chat_created
,is_channel_chat_created
functions toMessage
(#982)- Support for TBA 6.5 (#954)
- Add
can_send_audios
,can_send_documents
,can_send_photos
,can_send_videos
,can_send_video_notes
, andcan_send_voice_notes
toChatPermissions
andRestricted
- Add
use_independent_chat_permissions
optional parameter torestrict_chat_member
andset_chat_permissions
- Add
user_chat_id
field toChatJoinRequest
- Add
KeyboardButtonRequestChat
andChatShared
types - Add
RequestChat
variant toButtonRequest
- Add
ChatShared
variant toMessageKind
- Add
shared_chat
method toMessage
- Add
KeyboardButtonRequestUser
andUserShared
types - Add
RequestUser
variant toButtonRequest
- Add
UserShared
variant toMessageKind
- Add
shared_user
method toMessage
- Add
- Support for TBA 6.6 (#1040)
- Add methods for working with bot's description:
set_my_description
get_my_description
set_my_short_description
get_my_short_description
- Add methods for working with sticker sets:
set_custom_emoji_sticker_set_thumbnail
set_sticker_set_title
delete_sticker_set
set_sticker_emoji_list
set_sticker_keywords
set_sticker_mask_position
- Add parameter
emoji
to thesend_sticker
method to specify an emoji for just uploaded stickers - Add support for the creation of custom emoji sticker sets in
create_new_sticker_set
- Add parameter
needs_repainting
to thecreate_new_sticker_set
methodto automatically change the color of emoji based on context (e.g., use text color in messages, accent color in statuses, etc.) - Add field
needs_repainting
to theSticker
struct - Add support for the creation of sticker sets with multiple initial stickers in
create_new_sticker_set
by replacing the parameterssticker
,emojis
andmask_position
with the parametersstickers
andsticker_format
. - Add support for .WEBP files in
create_new_sticker_set
andadd_sticker_to_set
- Add support for .WEBP, .TGS, and .WEBM files in
upload_sticker_file
by replacing the parameterpng_sticker
with the parameterssticker
andsticker_format
- Add the ability to specify search keywords for stickers added to sticker sets
- Add new type
StickerFormatFlags
with fieldsis_animated
andis_video
- Add new method
Sticker::format
which returns the format of the sticker, the format is determined by theStickerFormatFlags
of theSticker
- Add missing fields
{InlineQueryResultGif, InlineQueryResultMpeg4Gif}::thumbnail_mime_type
- Add methods for working with bot's description:
- Support for TBA 6.7 (#1086)
- Add support for launching Web Apps from inline query results by replacing the parameters
switch_pm_text
andswitch_pm_parameter
of the methodanswer_inline_query
with the parameterbutton
of typeInlineQueryResultsButton
- Add new fields:
web_app_name
toWriteAccessAllowed
switch_inline_query_chosen_chat
of the typeSwitchInlineQueryChosenChat
toInlineKeyboardButton
via_chat_folder_invite_link
toChatMemberUpdated
- Add methods for working with bot's name:
set_my_name
get_my_name
- Add the ability to specify custom emoji entities using
HTML
andMarkdownV2
formatting options for bots that purchased additional usernames on Fragment
- Add support for launching Web Apps from inline query results by replacing the parameters
- Support for TBA 6.8 (#1087)
- Add the
MediaKind::Story
- Add new fields
PollAnswer::voter
to support anonymous poll answers in chatsemoji_status_expiration_date
toChat
as part of the futureChatFullInfo
type TBA type
- Add the
unpin_all_general_forum_topic_messages
method
- Add the
- Support for TBA 6.9 (#1095)
- Add
can_post_stories
,can_edit_stories
andcan_delete_stories
fields toChatMemberKind::Administrator
,ChatAdministratorRights
andPromoteChatMember
- Add
from_request
andfrom_attachment_menu
fields toWriteAccessAllowed
- Add
- Support for TBA 7.0 (#1101)
- Reactions:
- Add
ReactionType
enum - Add
MessageReactionUpdated
andMessageReactionCountUpdated
structs - Add
MessageReaction
andMessageReactionCount
variants toUpdateKind
enum - Add
filter_message_reaction_updated
andfilter_message_reaction_count_updated
filters toUpdateFilterExt
trait - Add
set_message_reaction
TBA method toRequester
trait - Add
available_reactions
field toChat
struct
- Add
- Replies 2.0
- Add the fields
MessageCommon::{external_reply, quote}
of typesExternalReplyInfo
andTextQuote
respectively
- Add the fields
- Link Preview Customization
disable_web_page_preview
replaced withlink_preview_options
:- Remove
disable_web_page_preview
field fromsend_message
andsend_message
TBA methods andInputMessageContentText
struct - Add
LinkPreviewOptions
struct - Add
link_preview_options
field toInputMessageContentText
andMessage
structs - Add
link_preview_options
field tosend_message
andsend_message
TBA methods
- Remove
- Multiple Message Actions
- Add TBA methods
delete_messages
,forward_messages
andcopy_messages
toRequester
trait
- Add TBA methods
- Chat Boost
- Add
ChatBoostSource
enum - Add
ChatBoost
,ChatBoostUpdated
,ChatBoostRemoved
andUserChatBoosts
structs - Add
ChatBoost
andRemovedChatBoost
variants toUpdateKind
enum - Add
filter_chat_boost
andfilter_removed_chat_boost
filters toUpdateFilterExt
trait - Add
get_user_chat_boosts
TBA method toRequester
trait
- Add
- Giveaway:
- Add
Giveaway
,GiveawayCreated
,GiveawayWinners
andGiveawayCompleted
structs - Add
Giveaway
,GiveawayCreated
,GiveawayWinners
andGiveawayCompleted
variants toMessageKind
enum - Add
giveaway
,giveaway_created
,giveaway_winners
andgiveaway_completed
getters toMessage
- Add
- Other Changes
- Add fields
ChafFullInfo::{has_visible_history, accent_color_id, background_custom_emoji_id, profile_accent_color_id, profile_background_custom_emoji_id}
- Add fields
- Add
RequestId
type - Add
CallbackQuery::regular_message
getter
- Reactions:
Fixed
- Return types of
edit_message_live_location_inline
,stop_message_live_location_inline
, andset_game_score_inline
:Message
=>True
(#854) - Remove
latitude
andlongitude
parameters fromstop_message_live_location
andstop_message_live_location_inline
(#854) - Fix the type of
photo_size
,photo_width
andphoto_height
in thesend_invoice
method (#936) - Fix roundtrip de/serialization of
InlineQueryResult
(#990) - Deserialization of
ApiError::CantParseEntities
(#839) - Deserialization of empty (content-less) messages that can sometimes appear as a part of callback query (#850, issue #873)
- Type of
chat_id
insend_game
:u32
=>ChatId
(#1066) Requester::Err
was bounded to theAsResponseParameters
. In case ofRetryAfter(..)
errors the polling is paused for the specified delay instead of falling into the backoff strategy (#1113)SendPoll
documentation (#1101, issue [#1058][issue1058])from
,sender_chat
andis_topic_message
are moved into theMessage
from theMessageCommon
(#1101, issue [#945][issue945]). Initially #946- Add support for
blockquote
entity in received messages + inMarkdownV2
andHTML
(#1101, issue [#1062][issue1062])
Changed
- Types of
Option<bool>
fields ofKeyboardMarkup
,KeyboardRemove
andForceReply
tobool
([#853][pr853]) - Type of
KeyboardMarkup::input_field_placeholder
:Option<String>
=>String
([#853][pr853]) - The following fields now use
Seconds
type instead ofu32
,u16
orDuration
(#859)Animation::duration
Audio::duration
Chat::message_auto_delete_time
Chat::slow_mode_delay
InlineQueryResultLocation::live_period
Location::live_period
MessageAutoDeleteTimerChanged::message_auto_delete_time
Poll::open_period
Video::duration
VideoNote::duration
Voice::duration
RequestError::MigrateToChatId
single fields type toChatId
(#859)RequestError::RetryAfter
single fields type toSeconds
(#859)CallbackGame
,ForumTopicClosed
,ForumTopicReopened
,GeneralForumTopicHidden
,GeneralForumTopicUnhidden
andWriteAccessAllowed
structures are now defined as named (struct S {}
) instead of unit (struct S;
) in order to fix their deserialization (#876)Download
now uses GAT feature on theFut
andErr
associated types, instead of a lifetime on the whole trait (#885)- Renamed
ForumTopic::message_thread_id
intothread_id
(#887) ForumTopic::thread_id
andMessage::thread_id
now useThreadId
instead ofi32
(#887)message_thread_id
method parameters now useThreadId
instead ofi32
(#887)DiceEmoji
variant order (#887)Dice::value
now useu8
, instead ofi32
(#887)Invoice::total_amount
,LabeledPrice::amount
,PreCheckoutQuery::total_amount
,SuccessfulPayment::total_amount
now useu32
, instead ofi32
(#887)Forward::message_id
andMessage::forward_from_message_id
now useMessageId
instead ofi32
(#887)Poll::total_voter_count
andPollOption::voter_count
now useu32
instead ofi32
(#887)PollAnswer::option_ids
now useu8
instead ofi32
(#887)- Use
u32
for sizes andSeconds
for timespans inInlineQueryResult*
(#887) SendGame::reply_to_message_id
,SendSticker::reply_to_message_id
andSendInvoice::reply_to_message_id
now useMessageId
instead ofi32
(#887)- Use
UpdateId
forUpdate::id
(#892) - MSRV (Minimal Supported Rust Version) was bumped from
1.64.0
to1.68.0
(#950) - Add proper support for
edit_message_caption_inline
,copy_message
,answer_inline_query
,answer_web_app_query
,send_media_group
,edit_message_media
, andedit_message_media_inline
toDefaultParseMode
adaptor (#961)- Note that now
DefaultParseMode
sets the default onsend
, instead of request creation DefaultParseMode
now also requires that the supported requests implementClone
(as a user you should not notice anything changing)
- Note that now
- Methods of the Message type:
delete_chat_photo
,group_chat_created
,super_group_chat_created
,channel_chat_created
,chat_migration
,migrate_to_chat_id
,migrate_from_chat_id
now return shared reference instead of owned value insideOption
(#982) - Methods
delete_chat_photo
,group_chat_created
,super_group_chat_created
,channel_chat_created
now return appropriate structs notOption<True>
(#982) - MSRV (Minimal Supported Rust Version) was bumped from
1.68.0
to1.70.0
(#996) - Changes in the existing API to support TBA6.6 (#1040)
InputSticker
was changed from enum to the struct{Animation, Audio, Document, Sticker, Video, VideoNote, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaVideo, StickerSet}::thumb
has been renamed tothumbnail
{SendAnimation, SendAudio, SendDocument, SendSticker, SendVideo, SendVideoNote}::thumb
has been renamed tothumbnail
- Now
StickerFormat
is defined as the enum with the variants:Static
,Video
,Animated
, so the previous variantRaster
has been renamed toStatic
- Method
StickerFormat::is_raster
has been renamed toStickerFormat::is_static
- Methods
StickerSet::{format, is_static, is_animated, is_video}
are deprecated now, due to the breaking change in TBA 7.2 API (which removesStickerFormatFlags::{is_video, is_animated}
from theStickerSet
class) - Method
set_sticker_set_thumb
and it's parameterthumb
have been renamed toset_sticker_set_thumbnail
andthumbnail
respectively - Fields
{InlineQueryResultArticle, InlineQueryResultContact, InlineQueryResultDocument, InlineQueryResultLocation, InlineQueryResultVenue}::{thumb_url, thumb_width, thumb_height}
have been renamed to{thumbnail_url, thumbnail_width, thumbnail_height}
respectively - Field
{InlineQueryResultPhoto, InlineQueryResultVideo, InlineQueryResultGif, InlineQueryResultMpeg4Gif}::thumb_url
has been renamed tothumbnail_url
- Support for TBA 7.0 (#1101)
- Replies 2.0
- Parameter
reply_parameters
of typeReplyParameters
replaces parametersreply_to_message_id
andallow_sending_without_reply
in the methods:copy_message
send_message
send_photo
send_video
send_animation
send_audio
send_document
send_sticker
send_video_note
send_voice
send_location
send_venue
send_contact
send_poll
send_dice
send_invoice
send_game
send_media_group
- Parameter
- Request for multiple users
- Struct
KeyboardButtonRequestUser
was renamed toKeyboardButtonRequestUsers
+ added fieldmax_quantity
to it - Field
KeyboardButton::request_user
was renamed torequest_users
MessageUserShared
was renamed toMessageUsersShared
- Struct
- Other Changes
Message::pinned_message
andCallbackQuery::message
now haveMaybeInaccessibleMessage
type- Field
emoji_status_custom_emoji_id
is allowed in non-private chats (moved to theChatFullInfo
) - Struct
Forward
was replaced byMessageOrigin
inMessageCommon
RequestId
replacesi32
inChatShared
andKeyboardButtonRequestChat
structs
- Replies 2.0
Deprecated
Update::user
, useUpdate::from
instead (#850)Message::from()
andMessage::sender_chat()
in favour of fields with the same name(initially #946#1101)
Removed
- Remove
can_send_media_messages
fromChatPermissions
(#954) - Remove
can_send_media_messages
field fromRestricted
(#954) - Previously deprecated items (#1013)
AutoSend
bot adaptorChatMemberKind::is_kicked
(useis_banned
instead)ChatMemberKind::is_creator
(useis_owner
instead)ChatMemberKind::{can_change_info, can_pin_messages, can_invite_users, can_manage_topics, can_send_polls, can_add_web_page_previews, can_send_other_messages, can_send_media_messages, can_send_messages}
(match onChatMemberKind
yourself)ChatMemberStatus::is_present
(useChatMemberKind::is_present
instead)InlineKeyboardButton::{text, kind}
teloxide::dispatching::{update_listeners, repls}
(usereloxide::{update_listeners, repls}
instead)Dispatcher::setup_ctrlc_handler
(useenable_ctrlc_handler
on the builder instead)BotCommands::ty
andrepls::{commands_repl, commands_repl_with_listener}
(useCommandsRepl::{repl, repl_with_listener}
instead)Message::chat_id
(use.chat.id
)Update::user
(useUpdate::from
)update_listeners::polling
(usePolling::builder
instead)
0.9.1 - 2023-02-15
Fixed
Update::user
now handles channel posts, chat member changes and chat join request updates correctly (#835)- In cases when
teloxide
can't deserialize an update, error now includes the full json value (#826) - Deserialization of topic messages (#830)
Added
ApiError::ImageProcessFailed
(#825)
0.9.0 - 2023-01-17
Changed
- The methods
ChatMember::{can_pin_messages, can_invite_users, can_change_info}
now take into account the permissions ofRestricted
chat member kind (#764) - The method
ChatMemberKind::is_present
now takes into account the value ofRestricted::is_member
field (#764) - The following functions were made
#[must_use]
:MaskPoint::{new, point}
StickerKind::{premium_animation, mask_position, custom_emoji_id}
Option<bool>
fields ofAdministrator
are nowbool
(#800):can_post_messages
can_edit_messages
can_pin_messages
can_manage_topics
ApiError::NotFound
is replaced withApiError::InvalidToken
which correctly parses all currently known errors caused by invalid bot tokens (#998)
Added
Restricted::{is_member, can_change_info, can_invite_users, can_pin_messages, can_send_polls}
fields (#764)ChatMember::can_send_polls
method (#764)- Support for Telegram Bot API version 6.3 ([#789][pr789])
- Support for Telegram Bot API version 6.4 (#809)
Deprecated
ChatMemberKind
methods (#800):can_change_info
can_invite_users
can_pin_messages
can_send_messages
can_send_media_messages
can_send_other_messages
can_send_polls
can_add_web_page_previews
ChatMemberStatus::is_present
method (#800)
Fixed
ChatMemberKind::can_manage_chat
method now correctly returnsfalse
for non owner/administrator users (#800)
0.8.0 - 2022-10-03
Added
- Support for Telegram Bot API version 6.2 (#251)
Changed
- Removed
file_
prefix fromFile
andFileMeta
fields #255 Animation
,Audio
,Document
,PassportFile
,PhotoSize
,Video
,VideoNote
andVoice
now containFileMeta
instead of its fields (#253)- Combined with
File
fields renaming, instead of.file_size
you can write.file.size
and similarly with other fields
- Combined with
- You can now
.await
anyRequest
! (#249)Request
now requiresSelf: IntoFuture
- There is no need for
AutoSend
anymore
- MSRV (Minimal Supported Rust Version) was bumped from
1.58.0
to1.64.0
- Message id parameters and fields now use
MessageId
type instead ofi32
(#254) - Refactored
Sticker
and related types (#251)
Removed
- Methods for creating
InlineQuery
(#246)
Fixed
SetWebhook
request can now properly send certificate (#250)- Serialization of
InputSticker::Webm
(#252)
Deprecated
AutoSend
adaptor (#249)
0.7.1 - 2022-08-19
Fixed
ErasedRequester<E>
now implementsClone
even ifE
is notClone
(#244)
Added
From<ApiError>
,From<DownloadError>
andFrom<std::io::Error>
impls forRequestError
(#241)
Changed
- More functions are now marked with
#[must_use]
(#242)
0.7.0 - 2022-07-19
Added
InlineKeyboardButton::{pay, login, web_app, callback_game, pay}
constructors (#231)- Support for Telegram Bot API version 6.1 (#233)
StickerKind
that is now used instead ofis_animated
andis_video
fields ofSticker
andStickerSet
(#238)
Changed
InlineKeyboardButtonKind::Pay
's only field now has typeTrue
(#231)file_size
fields are now alwaysu32
(#237)File
is now split intoFile
andFileMeta
, the latter is used inUploadStickerFile
andSticker::premium_animation
(#237)
Deprecated
InlineKeyboardButton::{text, kind}
functions (#231)
Removed
ChatPrivate::type_
field (#232)
0.6.3 - 2022-06-21
Fixed
- Fix
Message::parse_caption_entities
(#229)
0.6.2 - 2022-06-16
Fixed
- Fix
ChatPrivate
serialization (#226) - Build with particular crates versions (enable
"codec"
feature oftokio-util
) (#225) - Remove trailing
/
fromMessage::url
(on ios it caused problems) (#223) - Fix incorrect panic in
User::is_channel
(#222)
Added
Message::{url_of, comment_url, comment_url_of, url_in_thread, url_in_thread_of}
functions (#223)- Utilities to parse message entities (see
Message::parse_entities
) ([#217][pr217])
0.6.1 - 2022-06-02
Fixed
- Deserialization of
File
whenfile_path
orfile_size
are missing (#220) - Correct how
NotFound
andUserDeactivated
errors are deserialized (#219)
Added
is_*
methods toChatMemberStatus
analogous to theChatMember{,Kind}
methods (#216)ChatId
andUserId
to the prelude (#212)
0.6.0 - 2022-04-25
Added
- Support for Telegram Bot API version 6.0 (#206, #211)
- Note that some field were renamed
- Shortcut methods for
MessageEntity
(#208, #210)
Changed
- Make
KeyboardMarkup
creation more convenient (#207)- Accept
IntoIterator
inKeyboardMarkup::append_row
. - Accept
Into<String>
instead ofString
inInlineKeyboardButton::{url, callback, switch_inline_query, switch_inline_query_current_chat}
.
- Accept
0.5.1 - 2022-04-18
Fixed
- Document the
errors
module.
0.5.0 - 2022-04-13
Added
errors
module anderrors::AsResponseParameters
trait (#130)UserId::{url, is_anonymous, is_channel, is_telegram}
convenience functions (#197)User::{tme_url, preferably_tme_url}
convenience functions (#197)Me::username
andDeref<Target = User>
implementation forMe
(#197)Me::{mention, tme_url}
(#197)AllowedUpdate::ChatJoinRequest
(#201)ChatId::{is_user, is_group, is_channel_or_supergroup}
functions #198
Changed
user.id
now usesUserId
type,ChatId
now represents only chat id, not channel username, allchat_id
function parameters now acceptRecipient
[BC]- Improve
Throttling
adaptor (#130)- Freeze when getting
RetryAfter(_)
error - Retry requests that previously returned
RetryAfter(_)
error
- Freeze when getting
RequestError::RetryAfter
now has aDuration
field instead ofi32
Fixed
- A bug in
Message::url
implementation (#198) - Fix never ending loop that caused programs that used
Throttling
to never stop, see issue #535 (#130)
0.4.5 - 2022-04-03
Fixed
- Hide bot token in errors (#200)
0.4.4 - 2022-04-21
Added
WrongFileIdOrUrl
andFailedToGetUrlContent
errors (#188)NotFound
error (#190)HasPayload::with_payload_mut
function (#189)
0.4.3 - 2022-03-08
Added
User::is_telegram
function (#186)
Fixed
Update::chat()
now returnsSome(&Chat)
forUpdateKind::ChatMember
,UpdateKind::MyChatMember
,UpdateKind::ChatJoinRequest
(#184)get_updates
timeouts (partially revert buggy #180) (#185)
0.4.2 - 2022-02-17 [yanked]
Deprecated
Message::chat_id
use.chat.id
field instead (#182)
Fixed
- Serialization of
SendPoll::type_
(it's now possible to send quiz polls) (#181)
Added
Payload::timeout_hint
method to properly handle long running requests likeGetUpdates
(#180)
0.4.1 - 2022-02-13
Fixed
- Deserialization of
UntilDate
(#178)
0.4.0 - 2022-02-03
Added
ApiError::TooMuchInlineQueryResults
(#135)ApiError::NotEnoughRightsToChangeChatPermissions
(#155)- Support for 5.4 telegram bot API (#133)
- Support for 5.5 telegram bot API (#143, #164)
- Support for 5.6 telegram bot API (#162)
- Support for 5.7 telegram bot API (#175)
EditedMessageIsTooLong
error (#109)UntilDate
enum and use it for{Restricted, Banned}::until_date
(#117)Limits::messages_per_min_channel
(#121)media_group_id
field toMediaDocument
andMediaAudio
(#139)caption_entities
method toInputMediaPhoto
(#140)User::is_anonymous
andUser::is_channel
functions (#151)UpdateKind::Error
(#156)
Changed
- Refactor
InputFile
(#167)- Make it an opaque structure, instead of enum
- Add
read
constructor, that allows creatingInputFile
fromimpl AsyncRead
- Internal changes
- Refactor errors (#134)
- Rename
DownloadError::NetworkError
toNetwork
- Rename
RequestError::ApiError
toApi
- Remove
RequestError::Api::status_code
and renameRequestError::Api::kind
to0
(struct to tuple struct) - Rename
RequestError::NetworkError
toNetwork
- Implement
Error
forApiError
- Rename
- Use
url::Url
for urls, usechrono::DateTime<Utc>
for dates in types (#115) - Mark
ApiError
asnon_exhaustive
(#125) InputFile
and related structures now do not implementPartialEq
,Eq
andHash
(#133)- How forwarded messages are represented (#151)
RequestError::InvalidJson
now has araw
field with raw json for easier debuggability (#150)ChatPermissions
is now bitflags (#157)- Type of
WebhookInfo::ip_address
fromOption<String>
toOption<std::net::IpAddr>
(#172) - Type of
WebhookInfo::allowed_updates
fromOption<Vec<String>>
toOption<Vec<AllowedUpdate>>
(#174)
Fixed
- Deserialization of chat migrations, see issue #427 (#143)
- Type of
BanChatMember::until_date
:u64
->chrono::DateTime<Utc>
(#117) - Type of
Poll::correct_option_id
:i32
->u8
(#119) - Type of
Poll::open_period
:i32
->u16
(#119) Throttle
adaptor not honouring chat/min limits (#121)- Make
SendPoll::type_
optional (#133) - Bug with
caption_entities
, see issue #473 - Type of response for
CopyMessage
method (#141, #142) - Bad request serialization when the
language
field ofMessageEntityKind::Pre
isNone
(#145) - Deserialization of
MediaKind::Venue
(#147) - Deserialization of
VoiceChat{Started,Ended}
messages (#153) - Serialization of
BotCommandScope::Chat{,Administrators}
(#154)
Removed
get_updates_fault_tolerant
method andSemiparsedVec
(#156)
0.3.3 - 2021-08-03
Fixed
- Compilation with
nightly
feature (usetype_alias_impl_trait
instead ofmin_type_alias_impl_trait
) (#108)
0.3.2 - 2021-07-27
Added
ErasedRequester
bot adaptor,ErasedRequest
struct,{Request, RequesterExt}::erase
functions (#105)Trace
bot adaptor (#104)HasPayload
,Request
andRequester
implementations foreither::Either
(#103)
0.3.1 - 2021-07-07
0.3.0 - 2021-07-05
Added
impl Clone
for {CacheMe
,DefaultParseMode
,Throttle
} (#76)DefaultParseMode::parse_mode
which allows to get currently used default parse mode (#77)Throttle::{limits,set_limits}
functions (#77)Throttle::{with_settings,spawn_with_settings}
andthrottle::Settings
(#96)- Getters for fields nested in
Chat
(#80) - API errors:
ApiError::NotEnoughRightsToManagePins
,ApiError::BotKickedFromSupergroup
(#84) - Telegram bot API 5.2 support (#86)
- Telegram bot API 5.3 support (#99)
net::default_reqwest_settings
function (#90)
Changed
Message::url
now returns links to messages in private groups too (#80)- Refactor
ChatMember
methods (#74)- impl
Deref<Target = ChatMemberKind>
to makeChatMemberKind
's methods callable directly onChatMember
- Add
ChatMemberKind::is_{creator,administrator,member,restricted,left,kicked}
which checkkind
along withis_privileged
andis_in_chat
which combine some of the above. - Refactor privilege getters
- impl
- Rename
ChatAction::{RecordAudio => RecordVoice, UploadAudio => UploadVoice}
(#86) - Use
url::Url
for urls, usechrono::DateTime<Utc>
for dates (#97)
Fixed
- telegram_response: fix issue
retry_after
andmigrate_to_chat_id
handling (#94) - Type of
PublicChatSupergroup::slow_mode_delay
field:Option<i32>
=>Option<u32>
(#80) - Add missing
Chat::message_auto_delete_time
field (#80) - Output types of
LeaveChat
PinChatMessage
,SetChatDescription
,SetChatPhoto
SetChatTitle
,UnpinAllChatMessages
andUnpinChatMessage
:String
=>True
(#79) SendChatAction
output typeMessage
=>True
(#75)GetChatAdministrators
output typeChatMember
=>Vec<ChatMember>
(#73)reqwest
dependency bringingnative-tls
in even whenrustls
was selected (#71)- Type of
{Restricted,Kicked}::until_date
fields:i32
=>i64
(#74) - Type of
PhotoSize::{width,height}
fields:i32
=>u32
(#100)
0.2.2 - 2020-03-22
Fixed
- Typo:
ReplyMarkup::{keyboad => keyboard}
(#69)- Note: method with the old name was deprecated and hidden from docs
0.2.1 - 2020-03-19
Fixed
- Types fields privacy (make fields of some types public) (#68)
Dice::{emoji, value}
MessageMessageAutoDeleteTimerChanged::message_auto_delete_timer_changed
PassportElementError::{message, kind}
StickerSet::thumb
0.2.0 - 2020-03-16
Changed
- Refactor
ReplyMarkup
(#pr65) (BC)- Rename
ReplyMarkup::{InlineKeyboardMarkup => InlineKeyboard, ReplyKeyboardMarkup => Keyboard, ReplyKeyboardRemove => KeyboardRemove}
- Add
inline_kb
,keyboad
,kb_remove
andforce_reply
ReplyMarkup
constructors - Rename
ReplyKeyboardMarkup
=>KeyboardMarkup
- Rename
ReplyKeyboardRemove
=>KeyboardRemove
- Remove useless generic param from
ReplyKeyboardMarkup::new
andInlineKeyboardMarkup::new
- Change parameters order in
ReplyKeyboardMarkup::append_to_row
andInlineKeyboardMarkup::append_to_row
- Rename
- Support telegram bot API version 5.1 (see it's changelog) (#pr63) (BC)
- Support telegram bot API version 5.0 (see it's changelog) (#pr62) (BC)
Added
GetUpdatesFaultTolerant
- fault tolerant version ofGetUpdates
(#58) (BC)- Derive
Clone
forAutoSend
.
Fixed
- Make
MediaContact::contact
public (#pr64) set_webhook
signature (makeallowed_updates
optional) (#59)- Fix typos in payloads (#57):
get_updates
:offset
i64
->i32
send_location
: makelive_period
optional
send_contact
signature (phone_number
andfirst_name
f64
=>String
) (#56)
Removed
Message::text_owned
(#pr62) (BC)
Changed
NonStrictVec
->SemiparsedVec
.
0.1.1 - 2020-02-17
Fixed
- Remove
dbg!
call from internals (#53)
0.1.0 - 2020-02-17
Added
#[non_exhaustive]
onInputFile
since we may want to add new ways to send files in the future (#49)MultipartPayload
for future proofing (#49)- Support for
rustls
(#24) #[must_use]
attr to payloads implemented by macro (#22)- forward-to-deref
Requester
impls (#39) Bot::{set_,}api_url
methods (#26, #35)payloads
moduleRequesterExt
trait which is implemented for allRequester
s and allows easily wrapping them in adaptorsadaptors
module (#14)throttle
,cache_me
,auto_send
andfull
crate features- Request throttling - opt-in feature represented by
Throttle
bot adapter which allows automatically checking telegram limits (#10, #46, #50) - Request auto sending - ability to
.await
requests without need to call.send()
(opt-in feature represented byAutoSend
bot adapter, #8) get_me
caching (opt-in feature represented byCacheMe
bot adapter)
Requester
trait which represents bot-clients (#7, #12, #27){Json,Multipart}Request
theBot
requests types (#6)Output<T>
alias to<<T as HasPayload>::Payload as Payload>::Output
Payload
,HasPayload
andRequest
traits which represent different parts of the request (#5)GetUpdatesNonStrict
'telegram' method, that behaves just likeGetUpdates
but doesn't #2 fail if one of updates fails to be deserialized- Move core code here from the
teloxide
main repo, for older changes see it'sCHANGELOG.md
.- Following modules were moved:
bot
requests
[exceptrequests::respond
function]types
errors
net
[private]
client_from_env
was moved fromteloxide::utils
to crate root ofteloxide-core
- To simplify
GetUpdates
request it was changed to simply returnVec<Update>
(instead ofVec<Result<Update, (Value, serde_json::Error)>>
)
- Following modules were moved:
Changed
- Cleanup setters in
types::*
(remove most of them) (#44) - Refactor
KeyboardButtonPollType
(#44) - Replace
Into<Vec<_>>
byIntoIterator<Item = _>
in function arguments (#44) - Update dependencies (including tokio 1.0) (#37)
- Refactor file downloading (#30):
- Make
net
module public - Move
Bot::download_file{,_stream}
methods to a newDownload
trait- Impl
Download
for all bot adaptors & theBot
itself
- Impl
- Change return type of
download_file_stream
— returnStream<Result<Bytes>>``, instead of
Future<Result<Stream<Result>>>`` - Add
api_url
param to standalone versions ofdownload_file{,_stream}
- Make
net::{TELEGRAM_API_URL, download_file{,_stream}}
pub
- Make
- Refactor
Bot
(#29):- Move default parse mode to an adaptor (
DefaultParseMode
) - Remove bot builder (it's not useful anymore, since parse_mode is moved away)
- Undeprecate bot constructors (
Bot::{new, with_client, from_env_with_client}
)
- Move default parse mode to an adaptor (
- Rename
StickerType
=>InputSticker
,{CreateNewStickerSet,AddStickerToSet}::sticker_type}
=>sticker
(#23, #43) - Use
_: IntoIterator<Item = T>
bound instead of_: Into<Vec<T>>
in telegram methods which accept collections (#21) - Make
MessageDice::dice
pub (#20) - Merge
ApiErrorKind
andKnownApiErrorKind
intoApiError
(#13) - Refactor ChatMember (#9)
- Replace a bunch of
Option<_>
fields withChatMemberKind
- Remove setters (users are not expected to create this struct)
- Add getters
- Replace a bunch of
- Changed internal mechanism of sending multipart requests (#1)
- Added
RequestError::Io(io::Error)
to wrap I/O error those can happen while sending files to telegram - Make all fields of all methods
pub
(#3)