Which features do you use in your projects?
Final Results
50%
Entities DSL
90%
API extensions (like sendMessage)
50%
Behaviour Builder (Behaviour Context, etc.)
40%
Utils extensions (like ContentMessage.withContent)
70%
ClassCasts (like asContentMessage)
30%
Actions DSL (withTypingAction)
20%
LiveLocation DSL (startLiveLocation)
10%
Low level API (using of execute, overwriting of request factories, etc.)
40%
Serialization of tgbotapi types
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
FromUser improvements · Issue #484 · InsanusMokrassar/TelegramBotAPI
https://github.com/InsanusMokrassar/TelegramBotAPI/issues/484
https://github.com/InsanusMokrassar/TelegramBotAPI/issues/484
GitHub
FromUser improvements · Issue #484 · InsanusMokrassar/TelegramBotAPI
Check that all types with users implement FromUser Possibly, create type WithUser for cases when user is stored in field user instead of from Update class casts
New version
• As always, all deprecations have been removed
• New packages for extensions 😊 now you may write
• New keyboard DSL: say goodbye to
• New type
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
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
objectsBesides, 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
Telegraph
Changes in BehaviourBuilder triggers and new FSM extension
First of all, lets meet: I am maintainer of TelegramBotAPI. It is a framework which allow you to use telegram bots almost everywhere where you are able to run Kotlin (currently excluding native, but I hope it will be changed with Kotlin Native release). Some…
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:GitHub
Build entities separator by Djaler · Pull Request #486 · InsanusMokrassar/TelegramBotAPI
Option to specify a separator in buildEntities to insert between every entities
For some explanation:
buildEntities variant:
Should print "Some bold and italic and regular"
Second variant mostly about renaming
Of course, your solutions are welcome too
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 :) thanks to @djaler, we can meet 0.36.1 version with fixes in behaviour builder commands and new opportunity in entities builder - usage of separator and inheritage of it in subentities (like bold { })
GitHub
Release 0.36.1 · InsanusMokrassar/TelegramBotAPI
Common:
Version:
MicroUtils: 0.7.2 -> 0.7.3
API:
Fix getMyCommands overloads conflict when no arguments provided
Utils:
buildEntities DSL now have parameter separator to specify TextSo...
Version:
MicroUtils: 0.7.2 -> 0.7.3
API:
Fix getMyCommands overloads conflict when no arguments provided
Utils:
buildEntities DSL now have parameter separator to specify TextSo...
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 :)
• 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
Hello ;) I am starting preparations for new version release. Currently it is still possible for you to make some suggestions which could be included in 0.37.0 PR 😊
GitHub
0.37.0 by InsanusMokrassar · Pull Request #493 · InsanusMokrassar/TelegramBotAPI
Telegram Bot API 5.4 Update:
Added parameter creates_join_request to the methods createChatInviteLink and editChatInviteLink for managing chat invite links that create join requests
Added the fi...
Added parameter creates_join_request to the methods createChatInviteLink and editChatInviteLink for managing chat invite links that create join requests
Added the fi...
Version 0.37.0 is out and you may use Telegram Bot API 5.4 in your bots. Besides here:
• Improvements in Behaviour Builder FSM for more stype-strict using of states
• Dependencies updates
• Deprecations removing
P. S. See Examples migration commit for help in migration
• Improvements in Behaviour Builder FSM for more stype-strict using of states
• Dependencies updates
• Deprecations removing
P. S. See Examples migration commit for help in migration
GitHub
Release 0.37.0 Telegram Bot API 5.4 · InsanusMokrassar/TelegramBotAPI
ALL DEPRECATIONS WERE REMOVED
Common:
Version:
Klock: 2.4.6 -> 2.4.7
Ktor: 1.6.4 -> 1.6.5
MicroUtils: 0.7.3 -> 0.8.1
Core:
Replacement of simple CreateChatInviteLink and EditChatIn...
Common:
Version:
Klock: 2.4.6 -> 2.4.7
Ktor: 1.6.4 -> 1.6.5
MicroUtils: 0.7.3 -> 0.8.1
Core:
Replacement of simple CreateChatInviteLink and EditChatIn...
Forwarded from inmo.dev
InsanusMokrassar/TelegramBotAPI: 0.37.1
•
•
•
•
•
•
Common
:•
Version
:•
Serialization
: 1.3.0
-> 1.3.1
•
Klock
: 2.4.7
-> 2.4.8
•
MicroUtils
: 0.8.1
-> 0.8.2
GitHub
Release 0.37.1 · InsanusMokrassar/TelegramBotAPI
Common:
Version:
Serialization: 1.3.0 -> 1.3.1
Klock: 2.4.7 -> 2.4.8
MicroUtils: 0.8.1 -> 0.8.2
Version:
Serialization: 1.3.0 -> 1.3.1
Klock: 2.4.7 -> 2.4.8
MicroUtils: 0.8.1 -> 0.8.2
I have added several docker-oriented files in the template project. So, now it must be easier to create your projects from template and run your bot in the docker environment
GitHub
GitHub - InsanusMokrassar/TelegramBotAPI-bot_template
Contribute to InsanusMokrassar/TelegramBotAPI-bot_template development by creating an account on GitHub.
Unfortunatelly, I also wished to warren you that currently there are problems with running ktor client in Java:8 environment. That means that currently it is strongly not recommended to use it in your bots until ktor with fix of that issue will not be released.
Currently, I am using Java 11 and openjdk 11 docker image
Currently, I am using Java 11 and openjdk 11 docker image
YouTrack
Binary compatibility issue with Ktor 1.6.5 (affecting JDK 1.8 & 11 users) : KTOR-3358
I haven't checked the details yet but some tests using Ktor's testing module in our project detected a binary-compatibility issue. * https://github.com/slackapi/java-slack-sdk/runs/4087459078?check_suite_focus=true As a workaround, we locked the version to…
Hello :) I plan to remove several functions in MicroUtils library which seems to be useless. Could you answer, which one of these functions do you use in your projects? (thank you :) )
Anonymous Poll
100%
safely {}
100%
safelyWithouExceptions {}
100%
safelySkippingExceptions {}
100%
launchWithoutExceptions {}
100%
safelyWithResult {}
0%
runCatchingSafely {}
0%
safelyWithContextExceptionHandler {}
0%
runCatchingSafelyWithoutExceptions {}
Hello :) with the new update of Bots API was introduced the field
*
*
So, lets answer next question - what would be better?
has_protected_content
. I suppose, that this field will be added as additional interface PossiblyProtectedContentMessage
, but when I tried to add it, I faced to the fact that all Possibly*
interfaces could be extenders of ContentMessage
instead of just Message
. The problem here is that ContentMessage
require generic parameter and result PossiblyReplyMessage
could looks like:*
PossiblyReplyMessage
when it extends ContentMessage<MessageContent>
*
PossiblyReplyMessage<MessageContent>
when it extends ContentMessage<T>
So, lets answer next question - what would be better?
What will be better?
Final Results
0%
Left all "Possibly*" types extend "Message". That will help to avoid breaking changes
40%
Let "Possibly*" to extend "ContentMessage<MessageContent>". No breaking changes but fix hierarchy
100%
Let "Possibly*" to extend "ContentMessage<T>". Breaking changes but fully fix hierarchy