nerzh / swift-telegram-sdk

πŸ€– The wrapper for the Telegram Bot API written in Swift. It's not a framework. There is no special syntax here. This is a library that implements all Telegram Bot API methods, which is available to you to work with Vapor, Smoke, Hummingbird, FlyingFox.
https://core.telegram.org/bots/api#available-methods
MIT License
210 stars 32 forks source link

https://docs.python-telegram-bot.org/en/v13.15/telegram.ext.conversationhandler.html #34

Closed NikKovIos closed 1 month ago

NikKovIos commented 1 month ago

https://docs.python-telegram-bot.org/en/v13.15/telegram.ext.conversationhandler.html https://stackoverflow.com/q/68142791/5790492 https://stackoverflow.com/questions/68142791/how-to-get-several-inputs-in-one-command-in-telegram-bot-api

Does it has a support for conversationhandler or would have it in future?)

nerzh commented 1 month ago

you send documentation for python telegram bot. In the description of my library it is said that I do not enter any of my own DSL to implement logic. This library implements all methods according to the OFFICIAL api telegram bot api core.telegram.org/bots/api#available-methods. You can implement all other logic of your application as you like, you are not limited by anything.

nerzh commented 1 month ago

This library supports ALL methods and DataTypes from the official Telegram bot API.

NikKovIos commented 1 month ago

Thanks for your answer πŸ™πŸ»

Maybe you can help with advice about how to achieve question-answer behaviour like described in https://stackoverflow.com/questions/68142791/how-to-get-several-inputs-in-one-command-in-telegram-bot-api?

nerzh commented 1 month ago

You receive everything that Telegram sends you in the update, you can look at the Xcode to see what this data type consists of, you are a Swift developer, and Swift is a compiled language that allows you to successfully inspect any class. Or you can refer to the official documentation https://core.telegram.org/bots/api#getting-updates

then get the text or whatever interests you and do any logic you need, including, if necessary, react with a response to the user.

there are several options in the examples, run them and see what happens, put prints to understand what comes.

https://github.com/nerzh/swift-telegram-sdk/blob/master/Examples/Vapor-Telegram-Bot/Sources/Vapor-Telegram-Bot/TGBot/TGHandlers/DefaultBotHandlers.swift#L23

nerzh commented 1 month ago

I don't understand why you are asking this here and not in the server swift chat in telegram that I told you about?

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2024-09-16 Π² 23 39 03
NikKovIos commented 1 month ago

Thank you for your answers and time. This is a great project!