Kotlin Telegram Bot API Library (tgbotapi)


Channel's geo and language: World, English


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

Related channels

Channel's geo and language
World, English
Statistics
Posts filter




So, some small news about library for the last time:

1. 18.2.3 has been released with small fixes in middlewares side and adding of ExceptionsThrottlerTelegramBotMiddleware and I must warn you that it is mostly minor update
2. 19.0.0 has been released with update of Ktor up to 3.0.1 and MicroUtils up to 0.23.0. Thanks for migration to d1shin ❤️ and now I must warn you about Ktor Migration Guide for Ktor 3.0
3. 20.0.0 has been released with support of Telegram Bots API 7.11 and I must warn you, that they have added allow_paid_broadcast field (represented as allowPaidBroadcast in requests) which may spend your bot balance if it has any. So, be careful with passing of your trues without names. I even would like to recommend you to use named arguments for booleans anytime you may do it

It is all news about stability of library for today :D

P. S. Sorry, but I am trying hard to follow semver at least in manner I understand it


Soooooon 😏




Just to clarify: migration will happen sooner or later, but I want to know, how long it will be better to keep ktgbotapi on old ktor 2.* :)


Do you ready/want migration onto new ktor 3.0?
Poll
  •   Ready and want
  •   Ready
  •   Want
  •   Ready.... What?
23 votes


Hi :) I am here with new release: 18.2.0

• Update up to Telegram Bot API 7.10
• Fixes in giveaways-related serializations
• Fixes of several behaviour-builder related functions absence for some chat events and contents

In examples also there are several changes according to update:

WebApp sample has been expanded to work with both main and second buttons and be able to change all available colors
• New simple sample related to givaways has been added

I am totally not sure that every new API will work stable (in test time giveaways could have delays, as well as some updates).


One more update has been released: 18.1.0. This update related to changes in createSubContextAndDoWithUpdatesFilter: old logic has been used for it (now this function asynchronous and returns Deferred), but two new methods has been created: createSubContextAndDoSynchronouslyWithUpdatesFilter and createSubContextAndDoAsynchronouslyWithUpdatesFilter (current behaviour of createSubContextAndDoWithUpdatesFilter)


Hello everybody :) yesterday I have released 18.0.0. This update contains breaking changes, related to renames of ChatMember inheritors. Migration instructions available on the release page in github. In this release:

* Kotlin and other dependencies updates
* Add a lot of extension related to ChatMember (thanks to @McModder ) and ChatMemberUpdated
* Renames:
* RestrictedChatMember has been renamed to RestrictedMemberChatMember
* BannedChatMember has been renamed to RestrictedChatMember


Screenshot from 2024-08-22 19-32-26.png
45.7Kb
Fun fact: estimated cost of this library development is ~$2kk 🌚:

ktgbotapi$ docker run --rm -it -v "$PWD:/pwd" ghcr.io/lhoupert/scc:master scc /pwd
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
Kotlin 1160 74244 8419 7031 58794 978
Gradle 15 608 85 6 517 0
Markdown 11 4236 810 0 3426 0
YAML 9 134 9 11 114 0
Properties File 3 15 1 0 14 0
BASH 1 24 5 1 18 5
Batch 1 84 23 0 61 20
JSON 1 5 0 0 5 0
License 1 201 32 0 169 0
SVG 1 144 13 0 131 29
Shell 1 172 18 21 133 19
TOML 1 83 22 2 59 0
gitignore 1 15 3 0 12 0
───────────────────────────────────────────────────────────────────────────────
Total 1206 79965 9440 7072 63453 1051
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $2,109,454
Estimated Schedule Effort (organic) 18.26 months
Estimated People Required (organic) 10.26
───────────────────────────────────────────────────────────────────────────────
Processed 3341678 bytes, 3.342 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

238 1 3 4 145

Anyway, I released 17.0.0 with new API support. In two words:

* Now you may handle paid subscription invitation links
* New paid reaction
* You may turn on showing authors in channels and its support included

As a bonus: SendActionsDSL has been improved by me and DRSchlaubi


Yesterday I didnt realize that it is really special reaction, which is paid by user🌚




Such awesome reaction type 🌚


Hello everybody :) In library several news:

* Of course, support of the latest version of Telegram Bot API 7.8 in version 15.3.0
* Big event: migration onto Kotlin 2.0 (actually, 2.0.10 🌚) in version 16.0.0 🎉

Update up to 16.0.0 require special caution from developers side due to potential breakings. I will be glad to your reports of bugs/problems after update up to kotlin 2.0 and library 16.0.0


Besides, I wish to say additional thanks to user bpavuk for his huge help in this update


So, it happen. 15.1.0 has been released, 12 days after update 7.6 and 5 after 7.7. Samples has been updated too, so, you may try new paid media and other things in it. Whats new in two words (except of new APIs support):

* Add /privacy warning and additional extensions for BehaviourBuilder to simplify its setup
* Rename Photo as PhotoFile
* Add new level of TelegramMedia - now it contains TelegramFreeMedia (old TelegramMedia) and TelegramPaidMedia. For migration just replace TelegramMedia in your project to TelegramFreeMedia and in most cases it will be ok


So, in your opinion, what will be better as default behaviour?
Poll
  •   Just notify me, I will take all responsibility to handle /privacy
  •   Add autohandler if no manual handler and autohandler is not disabled
14 votes


You may know, some time ago Bots API News published notice about /privacy command and privacy police of each bot. In context of library there are two options to improve handling of this problem:

* Add some notification that privacy policy is not answered in /privacy command
* Add auto answer for /privacy when it has not been setup manually with content like this bot doing whatever it wants


Hello everybody :) 4 days after previous release Telegram team released new update for Telegram Bot API and clients. This update contains including of paid media support. Today BotNews public has published news that each bots creator will have to send privacy policies for each bot. To be honest, all the recent updates makes me a bit tilt. I do not know when I will be able to make new update implementation, but still will try to do that as soon as possible. In case you are really need new API in your bots, you may mention it, it will be a signal for me to hurry up

20 last posts shown.