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 everybody :) I have created a small prompt note about exceptions handling and hope that it will help you to find your bugs or investigate some incorrect behaviour 🤞
Forwarded from inmo.dev
InsanusMokrassar/TelegramBotAPI: 0.35.8

Common:
Version:
MicroUtils: 0.5.24 -> 0.5.25
UUID: 0.3.0 -> 0.3.1
Core:
MultipartRequestCallFactory now will use file name as multipart filename parameter instead of generated
filename
• New extension MPPFile#asMultipartFile
API
• Fixes in TelegramBot#withAction
Behaviour Builder:
• New extensions BehaviourContext#commandWithArgs and BehaviourContext#onCommandWithArgs
Hello :) I am preparing 0.35.9 for release and wished to know, what would you do with old versions of Behaviour Builder extensions. The difference between old and new methods related to using more powerful API in new methods. So, what should we do with old methods?
Release 0.35.9 has been published. Here I have to rewrite triggers in BehaviourBuilder, split LocationContent to different types and add opportunity to use *ln syntax inside of buildEntities (issue). Full changelog is here.
Besides, you may look at the migration example in this commit
Hello everybody :) Some time has past since 0.35.9 and it is time to plan 0.36.0. Currently next release should include dependencies updates, deprecations removing and improvements in BehaviourBuilder + FSM relations, but I will be glad to any suggestions 😊
Hello :) Currently in 0.36.0 I am preparing special version of BehaviourBuilder with FSM. How do you think, it would be better to include FSM in common BehaviourBuilder or create new extension with FSM?
Final Results
50%
New package with FSM - to avoid explicit things including if you want not to use FSM
50%
Including FSM in old BehaviourBuilder - to avoid new packages and enhance logic of standard builder
A little update is on the way :)
New version 0.36.0 has been released and it contains a lot of important changes:

• As always, all deprecations have been removed
• New packages for extensions 😊 now you may write tgbotapi.api instead tgboatpi.extensions.api and similarly for all other extensions. Old packages will be available until next major release
• New keyboard DSL: say goodbye to ReplyKeyboardMarkup(matrix { row { ... } }) and hello to replyKeyboard { row { simpleButton("") } }
• New integration of FSM into Behaviour Builder in new package tgbotapi.behaviour_builder.fsm: in this realization taken attention for more closed work with FSM inside of telegram bots
• New type WithUser. Now FromUser is extending WithUser and any tgbotapi type with user implements type WithUser. It is imortant, that constructors of classes-implementors of FromUser has changed their incoming parameters names from user to from due to renames inside of FromUser, but you still may use user field for FromUser objects

Besides, I recommend you to read a small note about flows and changes of mechanisms inside of behaviour builder and full changelog if you want to know all news
Hello :) currently @djaler is preparing improvement for Entities Builder. This improvement will add separator TextSource to EntitiesBuilder which will be automatically added between incoming text sources automatically. We faced with one important moment: we want to reuse separator in sub builders, BUT we are not sure how to make it good. There are several options we found:
For some explanation:

buildEntities variant:

buildEntities {
bold(
buildEntities { +"Some bold" + italic("and italic") }
)
+ "and regular"
}


Should print "Some bold and italic and regular"

Second variant mostly about renaming buildEntities extension in the example to make it more obvious (it is not very predictive on first try that the second buildEntities will reuse its parent separator)

Of course, your solutions are welcome too
Hello :) as you know, Telegram Bot API 5.4 has been introduced and becides I had updated FSM in my microutils libs. Due to these updates it was solved to:

• Make new major version
• Make breaking changes in FSM subproject
• Of course, implement telegram bot api 5.4 😊

Due to changes in FSM, it is not recommended to start some project with that. I plan to release new version in one week (ideally, this monday), so, I hope that the delay will not be big :)
Which JVM do you use in your bots?
Anonymous Poll
25%
Android :)
25%
8 (1.8)
0%
9
6%
10
63%
11
44%
>11