New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to deserialize an Update in a web server request handler? #87
Comments
Hello! Here I pasted a minimal workaround for using of webhooks: val bot = telegramBot("BOT TOKEN")
val flowUpdates = FlowsUpdatesFilter(64)
runBlocking {
bot.setWebhook(
"https://your.domain/some_secret",
8081,
flowUpdates,
Netty
)
} Unfortunately, currently it is impossible to work with updates directly "by hands" and it is supposed that you will use long polling (via |
I think it's not a rare case when bot developers will use BotFather to set up webhooks for their own web servers written on Ktor or Spring Boot. Even more, some bots may use Heroku or AWS Lambda (serverless) deployments, where it's impossible to have a long-running process listening for updates, and where every update triggers (wakes up) some computation. It's crucial to have an ability to deserialize payloads directly to |
Here |
Fixed in #88 |
I'm writing a TG webhook handler in Ktor. I guess, that in order to deserialize an
Update
, I need to useUpdateSerializerWithoutSerialization
/UpdateDeserializationStrategy
or have direct access toRawUpdate
(which is serializable).But all those classes are
internal
and cannot be used in user code. So, how do we deserialize incoming updates?The text was updated successfully, but these errors were encountered: