Kotlin Telegram Bot API Library (tgbotapi)
159 subscribers
17 photos
1 video
1 file
276 links
https://github.com/InsanusMokrassar/ktgbotapi

Channel with updates from Kotlin Multiplatform TelegramBotAPI library

DM: @InsanusMokrassar
Forum: @ktgbotapi_forum
Projects Releases: @inmodev
Support me: https://t.me/inmodev/431
Download Telegram
Hello, I am preparing new version of library and you may include your proposals about new features/fixes:) Welcome to our chat ▼
Small news on the fields of updates: Now you may use Github Packages in case you don't want to build project by yourself, but it is required to use some temporal version of project in your environment 🎉 Besides, new version is still in progress and you are welcome with your contributions 😊
New version of Telegram Bot API is here and I am already working on the update related to these news. Besides, I wished to notify you that you must update your TelegramBotAPI Servers (if you host any), because of otherwise you will not be able to get new types of updates by your bots via your servers
Forwarded from BotNews
Bot API 5.1

• Added updates about member status changes in chats: my_chat_member and chat_member
• Support for improved invite links
• Basic info about voice chats
• And more, read the full changelog here:

https://core.telegram.org/bots/api-changelog#march-9-2021

Warning: After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.
Several news about new version: update is in progress, but also it is close to release. Was solved to migrate onto 0.33.0 (major release) due to possible breaking of backward compatibility. Currently already covered all new functionality of Telegram Bot API and almost completed fixes related to this functionality in modules like Behaviour Builder
New version of TelegramBotAPI brings new update type: ChatMemberUpdated. I am thinking about necessity of adding something like "onChatMemberUpdated"/"waitChatMemberUpdated". So, should I add this functionality to "Behaviour Builder"? (multichoice)
Anonymous Poll
100%
onChatMemberUpdated
33%
waitChatMemberUpdated
ChatMemberUpdated (tglink) is an object, included in Telegram Bot API for looking at changes of users state in chats (but according to my investigations, not for private chats with bot) like changing admin state and others.
Besides, I wished to notice that all old methods, marked with Deprecated in previous versions were removed. Take care about it:)
Hello! I wish to rewrite all inheritations of CaptionedInput interface with TextedInput. This will give us opportunity to forget about some special fields like `caption` and use everywhere `text` field. What do you think about it?
Final Results
20%
We must separate captions for more clear understanding of data source
80%
We must leave one common interface to decrease boilerplate of the same actions with different parts
Hello again 😊 Currently I am thinking about filling of media cacher library (as analog of admins cache), because of there are a lot of cases when you are required to work with files (like photos or something else), but do not want to care about caching handling. Currently I see something like:

cacher.withCached(cachedFileId) {
bot.sendPhoto(chat, it)
}

Here I assume that it is InputFile and in case if value (media bytes) has been cached or at least FileId was saved we will get FileId and in case if request will throw error - pass MultipartFile as it to this callback and save returned FileId

Here there is one problem - how to save it for a first time? I see the following opportunity:

val someMessage: ContentMessage<MediaContent> = ... // some request with returned content message
cacher.cache(someMessage)

What do you think about it? Write your suggestions/opinions in comments :)
A little note: official libraries around Telegram Bot API are placed here
Hello:) several days ago has been released version 0.33.4. Here serialization of known TextSources, extensions for casting of messages to FromUserMessage and several other changes. Is there anything you seen in other libraries and wished to include in this? Or, maybe, something works improperly in your opinion? Write in comments, I will be glad to hear you😊
New version is almost here and I wished to notice you that in this version interfaces like Captioned will be deprecated and since 0.34.0 will be recommended to refactor your code to use text/textEntities properties and Texted-like interfaces
With new version of tgbotapi will be changed primary method of work with texts in objects with text (😊). Previously, textSource field was calculable property based on captionEntities/textEntities. This version will reverse logic. In new version textSource will be permanent field of Texted/Captioned instances and textEntities/captionEntities are calculable. It is possible, that work with TextPart will be totaly decreased in this version and fully removed in future. Stay tuned, new version will be soon😊
There are several questions we need to answer together:
Should we change version of kotlin up to 1.5.0 in 0.34.0 update with realization of Telegram Bot API 5.2?
Anonymous Poll
83%
Yes
17%
No
0.34.0 update deprecate Captioned interfaces. Explained interface is the same as Captioned and Texted. According to the deprecation logic for Captions we must deprecate explained too. Should we do this?
Final Results
100%
Yes
0%
No
Hello, I am preparing 0.34.1 hotfix update and wished to ask you about issues you faces or some suggestions. This update will be merged and released today:) so, hurry up 😏