![]() In this context, a token is a string that authenticates your bot (not your account) on the bot API. Getting Readyįirst, we will briefly cover how to create your first project, obtain your API token and download all necessary dependencies and libraries.įor the purposes of this guide, a copy of the bot you will be creating is also live at – feel free to check it out along the way to see how your own implementation should look after each step. ![]() If you pick another language, equivalent examples are available in C#, Python, Go and TypeScript. Since Java is fully cross-platform, each code example will work with any operating system. We will use Java 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. If you know how to code, you'll fly right through each step in no time – and if you're just starting out, this guide will show you everything you need to learn. While this can work for simple requests like the example above, it's not practical for larger applications and doesn't scale well.įor that reason, this guide will show you how to use libraries and frameworks, along with some basic programming skills, to build a more robust and scalable project. In theory, you could interact with the API with basic requests like this, either via your browser or other tailor-made tools like cURL. ![]() After obtaining your token, try pasting this string into your browser: ![]() Since your browser is capable of sending HTTPS requests, you can use it to quickly try out the API. There are several types of requests you can make, as well as many different objects that you can use and receive as responses. At its core, you can think of the Telegram Bot API as software that provides JSON-encoded responses to your queries.Ī bot, on the other hand, is essentially a routine, software or script that queries the API by means of an HTTPS request and waits for a response.
0 Comments
Leave a Reply. |