23 KiB
TelegramBotAPI changelog
0.22.0
-
KtorCallFactory
must returnHttpStatement
instead ofHttpClientCall
-
SendMessage
was renamed toSendTextMessage
and previousSendMessage
is deprecated -
All
AbleToBe*
interfaces was renamed toPossibly*
AbleToBeEditedMessage
->PossiblyEditedMessage
AbleToBeForwardedMessage
->PossiblyForwardedMessage
AbleToBeMarkedUp
->PossiblyMarkedUp
AbleToBeEditedMessage
->PossiblyEditedMessage
-
ForwardedMessage
type was renamed toForwardInfo
AnonymousForwardedMessage
->AnonymousForwardInfo
UserForwardedMessage
->UserForwardInfo
ForwardedFromChannelMessage
->ForwardFromChannelInfo
PossiblyForwardedMessage#forwarded
field now renamed toforwardInfo
-
All serializers in library now are
internal
. If you have used some of them or I have marked as internal by a mistake - don't hesitate to say this. -
EditChatMessage
now have generic type and extendsSimpleRequest<ContentMessage<GenericType>>
-
ResendableContent
now extendsRequest<out Message>
instead ofRequest<Message>
-
Most part of requests have changed return type. They are listed below:
ForwardMessage
GetChatAdministrators
EditChatMessageLiveLocation
StopChatMessageLiveLocation
EditChatMessageText
EditChatMessageCaption
EditChatMessageMedia
EditChatMessageReplyMarkup
SendAnimation
SendAudio
SendContact
SendLocation
SendTextMessage
SendPoll
SendVenue
SendGame
SendDocument
SendMediaGroup
SendPhoto
SendVideo
SendVideoNote
SendVoice
SendSticker
-
Changed type of
createResend
GameContent
LocationContent
PollContent
TextContent
VenueContent
AnimationContent
AudioContent
DocumentContent
ContactContent
PhotoContent
VideoContent
VideoNoteContent
VoiceContent
StickerContent
-
Version updates:
- Ktor
1.2.6
->1.3.0
- Ktor
0.22.1 MediaContent#asInputMedia
- All
MediaContent
instances now can create theirInputMedia
analog - New annotation
PreviewFeature
was added to mark new thing as preview for the time while they can work incorrectly - Added links utils:
makeLinkToMessage
have two signatures - for direct creating using username and for abstract creating using chat id
0.22.2 CashTag and independent updates handling
cashtag
entity type was added- Several
Unknown*
realizations was added:UnknownUpdateType
UnknownMessageType
UnknownChatType
UnknownCallbackQueryType
0.21.0 TelegramBotAPI 4.5
-
All
MessageEntity
'es now are replaced withTextPart
-
Added support of strikethrough and underline
- Added
UnderlineTextSource
- Added
StrikethroughTextSource
- Added support in
RawMessageEntity
- Added
-
Added support of
MarkdownV2
-
Now will not be thrown exception when there is income unknown type of
RawMessageEntity
. Instead of this will be createdRegularTextSource
with the same text -
Fixed problem that usually string formatting did not trigger escaping of control characters
-
Actualized work with
pre
type of text - now it is possible to uselanguage
for formatting of text -
Removed constructor of
TextMentionTextSource
, which was deprecated previously -
All
TelegramMediaFile
instances now have fieldfileUniqueId
, which representsfile_unique_id
field from API -
Now
ChatPhoto
have two additional fields:smallFileUniqueId
andbigFileUniqueId
-
Now any administrator object instance have
customTitle
nullable field -
Added the new request
SetChatAdministratorCustomTitle
to manage the custom titles of administrators promoted by the bot. -
Added the field
slowModeDelay
to theExtendedSupergroupChat
objects. -
CaptionedInput
now have extensionfullEntitiesList
which will return list ofTextPart
withRegularSource
's -
TextPart
added - it will be used as part of some text and can be not related to telegram bot -
MultilevelTextSource
was added - it is type ofTextSource
, which can have subsources as parts of this text -
In all
TextSource
s all fields now are lazy for avoiding of potential risk for performance issues -
Updates in versions:
- Coroutines
1.3.2
->1.3.3
- Klock
1.8.0
->1.8.6
- UUID
0.0.6
->0.0.7
- Coroutines
0.20.0 MPP Migration
- Time library change:
joda-time
->com.soywiz.korlibs.klock:klock
Currencied
now using ascurrency
value with typeString
- For
Java
there isCurrencied#javaCurrency
extension function, which will give an old currency work way
- For
User
now have no fielduserLocale
- For
Java
there isUser#javaLocale
extension function, which will give an old locale work way
- For
0.20.1
User
now implementPrivateChat
TextMentionMessageEntity
now acceptPrivateChat
instead ofUser
in main constructorTextMentionMessageEntity
now contains not user, but containsPrivateChat
- Fixed:
TextMentionMessageEntity#asHtmlSource
previously worked incorrect
- Abstraction
TextSource
MessageEntity
now extendsTextSource
createFormattedText
method now acceptList<TextSource>
createHtmlText
method now acceptList<TextSource>
createMarkdownText
method now acceptList<TextSource>
- A lot of
TextSource
implementors was added. More info here- All
MessageEntity
implementations now are using newTextSource
analogues as delegates
- All
0.20.2
- New exception type
MessageIsNotModifierException
was added - New exception type
MessageToEditNotFoundException
was added - Now exceptions in requests will be caught correctly
0.20.3
- Now
LeftChatMamber
is aCommonEvent
0.20.4
- Now
setWebhook
supports setting up of path for listening - Now
setWebhook
supports custom listen address even if certificate was not provided
0.19.0 ImplicitReflection removing
- Total rework of serialization for requests. Now all
SimpleRequest
children have:requestSerializer
- field, which must provide serializer of current typeresultDeserializer
- field, which must provide opportunity to deserializer result. Previously it was a function
- Removed deprecations:
com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.WebhookPrivateKeyConfig
com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.UpdatesFilter
com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.createSimpleUpdateFilter
com.github.insanusmokrassar.TelegramBotAPI.utils.createMarkdownText
com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption
com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownText
com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.KtorUpdatesPoller
com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent
com.github.insanusmokrassar.TelegramBotAPI.types.message.CommonForwardedMessage
com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.CaptionedInputMedia
com.github.insanusmokrassar.TelegramBotAPI.types.games.Game#text
com.github.insanusmokrassar.TelegramBotAPI.types.games.Game#textEntities
com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFileKt.makeFileUrl
com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFileKt.downloadingFilesBaseUrl
com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.Data
com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId
com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId
com.github.insanusmokrassar.TelegramBotAPI.bot.RequestException
com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.ReplyMessageNotFound
com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor#baseUrl
com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor#constructor(token, hostUrl)
com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor#constructor(token, client, hostUrl, callsFactories, excludeDefaultFactories, requestsLimiter, jsonFormatter)
com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor#constructor(token, engine, hostUrl)
0.18.0 Raws cleaning
-
Made internal and not available outside of library:
RawMessage
RawUpdate
RawChatMember
RawMessageEntity
RawInlineQuery
RawCallbackQuery
RawChosenInlineResult
-
All
RawMessage
usages was replaced withMessage
interface (with some of other raw classes was made the same things)TelegramBotAPIMessageDeserializationStrategy
was created. It was used for deserialization of Telegram Bot API incoming messagesTelegramBotAPIMessageDeserializeOnlySerializer
was created. It MUST NOT be used to serialize messages
-
Update of description
-
Make
Game
object a little bit more standartizated -
Game
now is not serializable and have no additional trash, related to serialization -
TelegramFile
was removed
0.18.1 Libraries update
- Update libraries:
kotlin
: 1.3.41 -> 1.3.61kotlin coroutines
: 1.2.2 -> 1.3.2kotlin serialization
: 0.11.1 -> 0.14.0joda time
: 2.10.3 -> 2.10.5ktor
: 1.2.3 -> 1.2.6
BotAction
now will be deserialized in a little bit other wayBotActionSerializer
now is internal
- Most part of serializers now are objects (instead of classes as was previously)
0.17.0 July 29, 2019 API Update
Libraries updates:
- Kotlin version
1.3.31
->1.3.41
- Kotlin Coroutines version
1.2.1
->1.2.2
- Kotlin Serialization version
0.11.0
->0.11.1
- Joda Time version
2.10.1
->2.10.3
- ktor version
1.1.4
->1.2.3
Changes according to July 29, 2019 Telegram Bot API update:
Sticker
andStickerSet
now have fieldisAnimated
ChatPermissions
object was added,GroupChat
interface gotpermissions
field, requestSetChatPermissions
was addedGroupChat
object now have no fieldallMembersAreAdmins
SpecialRightsChatMember
was added for administrators and restricted members rights union, chat members abstractions was replaced intoabstracts
package and available permissions was updatedRestrictChatMember
request now acceptpermissions
object instead of separated permissions- All
GroupChat
instances have description
Other important changes:
- Totally reworked chats hierarchy.
Extended
abstractions was added for cases when calledGetChat
request RawChat
boilerplate was removed and replaced by serializersBotCommandMessageEntity#command
will not contain/
/!
parts and also will cut outside of command begin token (/
or!
) and username token (@
) or end of command (any space character)RequestsExecutor
now isCloseable
TelegramAPIUrlsKeeper
was added to provide more comfortable work with file urls and other things like this
0.16.0 Bot API 4.3
LoginURL
andLoginURLInlineKeyboardButton
has been addedreplyMarkup
field was added to theCommonMessage
objects viaAbleToBeMarkedUp
interfaceSwitchInlineQueryCurrentChatInlineKeyboardButton#switchInlineQueryCurrentChat
field fixedInlineKeyboardButton
now is sealed class and all its possible realisations are inside of its class fileString#asUsername
method renamed toString#toUsername
- Several
toChatId
extensions added
0.16.1
- Now old uncommon
CaptionedMediaContent
andCaptionedInputMedia
are replaced by almost the same interfacesCaptionedInput
andCaptionedOutput
. They are both implementingCaptioned
interface AnimationContent
now isCaptionedInput
0.15.0
- Old
UpdatesPoller
removed (was deprecated) UpdatesPoller
renamed toKtorUpdatesPoller
- Now
KtorUpdatesPoller
do not use additional delay between requests and await answer from Telegram all timeout time - Added abstraction
UpdatesPoller
- Changed signature of the most count of
startGettingOfUpdates
:- They are not
suspend
for now - They are return
UpdatesPoller
- They are using
timeoutMillis
instead ofrequestsDelayMillis
- They are not
- Added
CIO
ktor client engine as lightweight default engine for long-polling
0.14.0
- Now library have no default engine for both webhooks and requests executor. It is required for clients to set some default library
- All proxy help methods was removed . They are will be replaced in separated project
Ktor
version1.1.3
->1.1.4
- Requests results now always decoding as
UTF-8
AbstractRequestCallFactory
was added with cache of methods urls to avoid memory leaks- Small refactoring of work with response in
KtorRequestsExecutor
- Kotlin version
1.3.30
->1.3.31
- Kotlin coroutines
1.2.0
->1.2.1
CommonForwardedMessage
was renamed toUserForwardedMessage
- All forwarded messages are now just childs of
ForwardedMessage
:AnonymousForwardedMessage
- for messages without forwarded infoUserForwardedMessage
- for messages from users and groups (contains not message id)ForwardedFromChannelMessage
- for messages from channels
- Changed logic of forwarded messages preparing
0.14.1
- Replace
UpdatesFilter
andUpdatesPoller
into another package - Replace
WebhookPrivateKeyConfig
- Added
FlowsUpdatesFilter
UpdatesFilter
now have additional callback for pollsStopPoll#replyMarkup
now is optional
0.14.2 MediaGroups edit hotfixes
convertWithMediaGroupUpdates
extension added- All media group converting extensions are internal for now
- Fixes according to updates in converting of updates to media group updates
0.13.0 Telegram Polls
- Type
PollOption
andAnonymousPollOption
added - Type
Poll
added - Type
PollUpdate
added and implemented inRawUpdate
. NowPollUpdate
can be retrieved fromRawUpdate
- Type
PollContent
added - now it can be a value ofContentMessage#content
- Request
SendPoll
added andPollContent#createResend
now use it ByInlineMessageId
is deprecated (useInlineMessageAction
instead)ByMessageId
is deprecated (useMessageAction
instead)- Most part of requests which are working with identifiers of messages now implement
MessageAction
directly or by their parents StopPoll
implemented- All current
Chat
abstractions are deprecated and rewritten as typealiases. UseChat
abstractions fromcom.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
package - Common Groups now may have pinned message
is_member
field added intoRestrictedChatMember
- BREAK CHANGES Now
ForwardedMessages
can beAnonymousForwardedMessage
andPublicForwardedMessage
. Old implementations now extendPublicForwardedMessage
0.12.0 Webhooks
- Added
DataRequest
interface which replaceData
interface MultipartRequestImpl
now useDataRequest
- All requests which implements
Data
now implementDataRequest
- Added class
SetWebhook
and its factory - Added class
UpdatesFilter
which can help to filter updates by categories - Added function
accumulateByKey
which work as debounce for keys and send list of received values - Added webhooks functions and workaround for
Reverse Proxy
mode - Added new type of updates
MediaGroupUpdate
, which can be received only from filters UpdatesFilter
now use new type of updates for mediagroups- Add
GetWebhookInfo
request andWebhookInfo
type - Replace updates types into separated place in types
- Now default
RequestException
will contain plain answer from telegram - Added
UnauthorizedException
RequestException
now is sealed- Rename
ReplyMessageNotFound
toReplyMessageNotFoundException
- Added
List<BaseMessageUpdate>#mediaGroupId
extension - Added utility
T#asReference(): WeakReference(T)
extension - Added
UpdatesPoller
class which can be instantiated for manage updates polling - Separated execute extensions (now they are in file
Executes
) and poller creating extensions BaseMessageUpdate#toMediaGroupUpdate()
will also check condition when update-receiver already isMediaGroupUpdate
0.12.1 Hotfix for media groups
- Added additional media group types (like
MessageMediaGroupUpdate
) - Fixed handling of media group updates in
UpdatesFilter
0.12.2
- New in
MediaGroupUpdate
:- It is subtype of
Update
and can be use as regular update with list of messages - Data now is list with
MediaGroupMessage
- Added field
origins
which represent origin updates forMediaGroupMessage
updateId
now represent LAST id of origins updates
- It is subtype of
UpdatesFilter
and other objects now work withUpdateReceiver<Update>
as common supertype for receivers.
0.12.3 Cleaning
- Refactor, optimizing and cleaning of code
- Removed deprecated method
T#toJsonWithoutNulls()
- Renamed instances of
MediaGroupMessage
s and refactored their interfaces.ChannelMediaGroupMessage
will not containuser
field (butCommonMediaGroupMessage
will have) - Now
MediaCollectionContent
isMediaContent
(classes of this interface must choose best media for present out)PhotoContent
now choose biggest photo size from its collection asmedia
- Fix in order of media group messages which was received by webhooks
0.12.4
- Optimized preparing of media group in
UpdatesPoller
- Add
CommonLimiter
- Add
MessageEntity#asHtmlSource
andString#toHtml
- Add tools for work with html captions and texts
MessageContent
which using captions or text now have default parse modeHTMLParseMode
due to issue with escaping of]
in links titles- Added
Markdown
andHTML
type aliases which actually meansMarkdownParseMode
andHTMLParseMode
ChatId
now have extensionlink
which will automatically create link liketg://user?id=<chatId>
- Created a few of methods for all supported formats of text like bold, italic, links and others
- Rewritten
MessageEntities
to use new formatting options
0.12.5 MediaContent
improvements
- Now
MediaGroupContent
isMediaContent
- All
MedaContent
now have no generics and have basicTelegramMediaFile
media field
0.12.6 Libraries updates
kotlin
version1.3.21
->1.3.30
kotlin coroutines
version1.1.1
->1.2.0
kotlin serialization
version0.10.0
->0.11.0
ktor
version1.1.2
->1.1.3
- Added
DeleteWebhook
request - All default
startGettingOfUpdates
(in fact - methodstart
ofUpdatesPoller
) are suspend and will try to delete webhook
0.12.7 Hotfix version
- Now temporary all requests of input media will contains
file
field
0.11.0
- Kotlin
1.3.11
->1.3.21
- Kotlin coroutines
1.1.0
->1.1.1
- Kotlin serialization
0.9.1
->0.10.0
- Ktor
1.1.1
->1.1.2
0.10.0
- Most part of abstractions was replaced from
requests
andtypes
on more high level - Added abstraction
CommonVenueData
- Added abstraction
CommonContactData
- Added
InputMessageContent
- Update some types and requests according to abstractions replacing
- Add all
InlineQueryResult
,InputMessageContent
and other inline mode types - Fixes in edition of inline messages and their result types
- Replace basic exception and add
ReplyMessageNotFound
exception
0.10.1
- Change algorithm of
executeUnsafe
: now it use loop instead of recursive calling - Add additional
startGettingUpdates
with better management of received updates for media groups - Now
MediaGroupMessage
isCommonMessage
withMediaGroupContent
content - Added extensions
replyTo
,forwarded
andchat
forList<BaseMessageUpdated>
for comfortable work with media groups lists - Fix
parseMode
ofInputTextMessageContent
0.10.2
- Fixes in
Username
- Now you can create username object using string which is not starting with
@
- Now
Username
correctly comparing with strings, which are not starting with@
- Now you can create username object using string which is not starting with
- Now most part of usernames in library have type
Username
- Fix
replyMarkup
inInlineQueryResultArticle
0.10.3
- Hotfix for username data class
0.9.0
- Old extension
OkHttpClient.Builder#useWith
now deprecated and must be replaced by the same incom.github.insanusmokrassar.TelegramBotAPI.bot.Ktor
package - Replace
ProxySettings
data class insettings
package, deprecate old link BaseRequestsExecutor
now have no it's own scope- Add
RequestLimiter
and base realisations - Now
KtorRequestsExecutor
can receive as one of parametersRequestLimiter
(by default -EmptyLimiter
)
0.9.1
- Updated built-in lengths restrictions
- Apply restrictions of text limit for sending messages
- Add
RegularTextMessageEntity
which is useful for representing regular text message entity - Add
convertToFullMessageEntityList
which create list of entities withRegularTextMessageEntity
on places where must be regular text - Change signature of
createMarkdownText
: now it will return list of strings - Deprecate old signatures of
createMarkdownText
,toMarkdownCaption
,toMarkdownText
- Add
ResendableContent#createResends
which create adapted list of resends for content - Add
TextContent
owncreateResends
realisation
0.9.2
RequestsExecutor#executeAsync(Request, CoroutineScope)
now will returnDeferred
for cases when you need resultRequestsExecutor#executeUnsafe
will automatically retry request if it was unsuccessful and retries > 0
0.9.3
KtorRequestsExecutor
now can use customJSON
string formatter (by default - non strict)ResponseParameters
renamed toResponse
- Add
RequestError
sealed class and described in documentation known errors - Add
ResponseParametersRaw
which can create error based on input parameters - Add
parameters
field inResponse
and remove useless fields fromResponse
- Add
leftToRetry
parameter inRetryAfterError
- Add handling of
RetryAfterError
inKtorRequestsExecutor
0.8.5
- Add extension
String#toMarkdown
- Fix of inserting of text when create Markdown-adapted text from text and text entities
- Fix default realisation of MessageEntity#asMarkdownSource
0.8.4
- Added
createMarkdownText
and extensions forCaptionedMediaContent
andTextContent
- Added
ResendableContent
and realize in different contents- Animation
- Audio
- Document
- Photo
- Sticker
- Video
- VideoNote
- Voice
MessageContent
now isResendableContent
- Now all media sending factories which contains
thumb
have defaultnull
value ChatIdentifier
classes now aredata
classes- Now
MediaGroupContent
interface containstoMediaGroupMemberInputMedia
method for easily creating mirror input media - Change signature of
Update
- Now
Update
is untyped and data isAny
- Now
- Media groups now are separated type of updates and you can subscribe on that receiving directly
- Now
AdministratorChatMember
is interface andCreatorChatMember
implement it
0.8.3
- Now
ForwardedMessage
contains nullablefrom
0.8.2
- Add
FromUserMessage
which must be implemented in all messages realisations which haveuser
field - Add
CommonMediaGroupMessage
which in fact extension ofMediaGroupMessage
with implementation ofFromUserMessage
CommonMessageImpl
now implementingFromUserMessage
0.8.1
- Update
MediaGroupMessage
interface - Add implementation of
MediaGroupMessage
- Add generating of
MediaGroupMessage
inRawMessage