Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
intellij-plugins
Open-source plugins included in the distribution of IntelliJ IDEA Ultimate and other IDEs based on the IntelliJ Platform
-
libcurl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Unfortunately, it features Java, Maven, and rubenlagus/TelegramBots library.
In this tutorial, we’ll use InsanusMokrassar/TelegramBotAPI, but you can follow along with any equivalent implementation since all the underlying methods are either similar or exactly the same.
To program in Kotlin, you’ll need an IDE — a special text editor that will let you write, compile and run your code. In this tutorial, we’ll use IntelliJ IDEA — there are several free, open source alternatives like Eclipse or NetBeans which work in the exact same way.
We will use Kotlin throughout this guide as it’s one of the most popular programming languages, however, you can follow along with any language as all the steps are fundamentally the same. Since JVM is fully cross-platform, each code example will work with any operating system. If you pick another language, equivalent examples are available in C#, Python, Go and TypeScript.
You can place this code wherever you prefer, the important thing is to make sure that keyboard variables are accessible from the method call that will send the new menu. If you’re confused by this concept and don’t know where to put them, just paste them above the command processing flow. Or just look at the final code here.
In theory, you could interact with the API with basic requests like this, either via your browser or other tailor-made tools like cURL. While this can work for simple requests like the example above, it’s not practical for larger applications and doesn’t scale well.
At its core, you can think of the Telegram Bot API as software that provides JSON-encoded responses to your queries.
General Bot Platform Overview