GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing monsterdeveloper.gitbook.io — Lesson 1. Simple echo bot | Java Telegram Bot Tutorial Hello! If you want to know, how to code Telegram Bots on Java, you are on the right way! Prepare to launchBot API is based on HTTP-requests, but in this book I will use Rubenlagus' library for Java. Install the libraryYou can install TelegramBots library with different methods:
In this tutorial I will use next machines:
Lets go to code!Well, enough for words. Let's get down to buisness. In this lesson we will write simple bot that echoes everything we sent to him. Now, open Now, when you are in the project, create files
As you can understand, Now, let's move on to the logic of our bot. As I said before, we want him to reply every text we send to him. Good! But how do I run the bot? Well, its a good question. Lets save that file and open Now, lets initialize Api Context Instantiate Telegram Bots API: And register our bot: Here is all our files:
Well done! Now we can pack our project into runnable You can find all sources to this lesson in GitHub repository. Now we can see our bot running: ![]() Well, thats all for now. Hope to see you soon!:) Last updated |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |