Telegram bot “Telegraph. Bots for telegram What bots are there in telegram

Greetings to Telegram users. I continue my story about the super popular messenger. I specially selected the most useful bots for Telegram. I checked everything manually, so they will be really interesting, and, importantly, understand the simplest commands.

We discussed it in the last article, I advise you to read it first.

Let me briefly remind you of the algorithm for using the bot:

  • find by search or follow the link in the article,
  • request a command
  • call the menu automatically or by pressing the “/” sign.

Selection of bots

Chat of Telegram specialists

Friends, we created a chat in which we gathered everyone who works with channels and chats in Telegram. You can ask for help working with bots and discuss any issue with participants.

Join the chat:
t-do.ru/joinchat/EVgZrUgkpH_nz-uvWAnmkQ

Sport

News of sports and healthy lifestyle.

  • @sportexpress_bot - the latest news from the best journalists of the largest sports site on the Runet.
  • @sportsru_bot is another guide to the world of the latest sports news, results and live broadcasts.
  • @sportfolks - for lovers of a healthy lifestyle. Every day you will receive advice on training and nutrition.

Content

Are you interested in videos, pictures, music? Read how to make working with such content easier.

  • @ivideobot is a great assistant, ready to download any video from YouTube. Just send him the link you need, and in a second you will receive the result.
  • @music - lovers of classical music will really like the bot, because you can easily download and listen to your favorite works without leaving Telegram.
  • @imagesearchbot - searches for images by keyword, and also allows you to select the quality of the photo to download.
  • @instasave_bot - will find any picture or video on Instagram and download it for you. To work, paste the link to the desired account.
  • @yabot is a Yandex search engine.

News

Latest news, gossip, incidents delivered to your phone.

  • @tgnewsbot - will tell you all the latest news and rumors about Telegram.
  • @lifehackerrubot - a collection of tips from the popular site of the same name.
  • @vestiru_bot - summaries of the hottest events from the federal channel Vesti 24.
  • @lifenews - find out the news first, use the Lifenews channel bot.

Business and finance

For businessmen and those who want to become one.

  • @rubbot – current exchange rates, as well as the cost of a barrel of oil.
  • @pravorubot - the best lawyers from all over the country are ready to solve any of your problems.
  • @egrul_bot - checks counterparties by TIN or OGRN number. All information from official websites.
  • @greenzBot - the family budget is now under control. Count your expenses and sum up the results without leaving the messenger.

Games and entertainment

Here are collected assistants whose task is to entertain the user.

  • @BukToPuHa is a famous game with thousands of participants. Simple and complex tasks. Competitions with ratings.
  • @Hangbot - guess the word and save your life.
  • @questgamebot is the first quest for Telegram. Click “Start” and you will find yourself in an exciting story.
  • @baneksbot – top popular jokes. There is a subscription to fresh jokes, as well as ratings of the best jokes for a certain period of time.
  • @slotobot is a complete simulation of a slot machine. Virtual money, competitions with friends.
  • @RadioBot - will teach you how to listen to the radio directly in the messenger. Select a station, broadcast hours, download the recording and listen.

Search engines

Bots search for useful information from different areas. From the weather to culinary recipes.

  • @weatherman_bot - accurate weather forecast at a given point, plus the ability to send reports in the morning and evening.
  • @gdecafebot - will show a list of cafes, restaurants, eateries near your location. Requires your coordinates.
  • @aliexplorerbot - daily information about the best deals on AliExpress.
  • @search_rutracker_bot is an illegal Rutracker bot. Well, let's have a little fun?

Reading and translation

Assistants to book lovers and translators.

  • @misis_bot - a complete collection of books from the MISIS Technological University. Choose a topic and dive into the world of technology.
  • @flibustafreebookbot - downloads books from Flibusta - a free online library.
  • @bookshopbot is a real library of paid and free literature.
  • @ytranslatebot is a free translator from Yandex.

When choosing bots, I used the store - storebot.me. I recommend looking for them there. There are convenient categories and reviews from real people.

How to remove a bot

If the robot is boring or no longer needed, feel free to get rid of it. To do this, you can delete the dialog or use the complete blocking function.

See how to do it.

From phone

On an iPhone, everything is simple - swipe the dialogue with the bot to the left and click “Delete”.

There are several ways on Android.

Method 1. Long tap on the name in the general list of chats and “Delete and stop”.

Method 2. Click the button with three dots at the top right and select “Delete chat”.

Add to catalog

The entire list of Telegram bots on one page! We have collected for you the best, interesting and useful bots for Telegram!

Add your bots

The list of bots we have collected is not exhaustive and we hope to significantly expand it with your help! Add your bot or just an interesting one to a special form and it will appear on the site after checking by our moderator.

Telegram bot is a special program created to execute specified commands in the messenger, based on data received from the user.

The first bots in Telegram that Russian-speaking clients of the messenger encounter are automatic profiles that send out localization files, for example, Robot Anton.

You can create an algorithm yourself. Another – simpler – option is to download and install a ready-made one. About how to install the Telegram bot, how much this service costs and how to get the Russian version for free.

How bots work for the Telegram messenger in Russian

Anyone who has decided to learn a little more about a program such as telegram bot is interested in what can be done with the help of bots. In fact, they can automatically perform many different important functions. Moreover, it opens access to new functions. So, using these algorithms you can:

  • play in Telegram,
  • look for the necessary information,
  • send messages,
  • and even teach.

Some users who have just started using the system have a question regarding programs such as Telegram robots: can the bot be trusted? Is there a risk of losing your account or, worse, becoming a victim of a hacker, losing control over the entire device? Fortunately, this is excluded - bots are extremely useful. They are completely safe to use.

And thus, the popularity of Telegram bots is growing every day. This is really useful: without leaving the messenger, you can download movies, books, music. And also very quickly find out the exchange rate. Bots are your personal assistant in work and in life. Especially for readers of the Internet Sales Agency blog, I have made a selection of useful Telegram bots.

File storage and sharing

Converts documents to PDF files. Supports DOC, DOCX, ODT, TXT and JPG.

Saves files weighing up to 20 MB to Google Drive.

Able to store documents and share them with other users.

Another assistant for working with files: uploads to cloud storage and provides permanent links to them.

Exchange rates

Shows the current exchange rate.

Exchange rates, oil quotes, bitcoin and gold. Shows current rates at the moment.

Downloading torrent files

Downloads torrent files from Rutracker, which is blocked in Russia, without going to the website.

Search and download books

@freebooksbot, @mybookbot

Search books by request. You are prompted to select a format and save the file to Dropbox cloud storage.

Search movies

Helps you find a movie to watch. Choose a movie category and the bot offers you different options.

Online cinema on your smartphone directly through messenger. Enter the name of the film you are interested in and receive a link to watch it online.

For music lovers

This bot searches and downloads music from SoundCloud and videos from YouTube. A great find for music fans who don’t want to leave the messenger to find and send their favorite song.

Sends you the best and most popular songs of the day.

Search for anything

Searches for everything: clothes, books, films, air tickets, hotels, the cheapest taxis. Works with Flibusta, RuTracker, VKontakte and other resources.

Personal Secretary

Reminder bot. You write a message, specify the date, and receive a reminder in Telegram.

Secretary bot: creates a to-do list, saves links and notes. Once a day it reminds you of all the tasks that are still open. Helps you not to forget about your plans!

@shoplist419_bot

This bot can be used to create shopping lists that can be shared. It notifies you about changes from other users and crosses out purchased items with one click. Great for group shopping if you're not nearby.

Personal finance accounting

Accounting for personal finances: income, expenses, debts. All records are entered into a special Google table. Requires registration via email in order to link a report to it.

Acquaintance

@matchmaker_bot, @hotorbot

For those who are tired of Tinder and want to try something new. You fill out a short questionnaire (gender, age, photo, who you are looking for and why), after which the bot offers various options (photo attached). True, there is no filter for reference to a specific city, but you can set a radius in which the search for your interlocutor will take place.

Free Internet

You can ask the bot for the WiFi password in a public place.

Working with mail

Search assistant for mail, cloud storage, contacts. Works with Gmail, Evernote, Dropbox, OneDrive.

Creates a temporary box and displays its contents. It deletes it all itself in 10 minutes. Convenient if you do not want to share your email address, for example, when delivering pizza.

Translator

Translator bot from Yandex.

English language learning

Helps you practice English. You can choose to study only individual words, grammar, or build a dialogue. Offers audio with correct pronunciation.

Another helper in learning English. You can request the interpretation of a word or get an explanation of any expression from the bot's dictionary.

Improve your English language skills with useful pictures with idioms and common words. Contains audio lessons and educational materials.

@pronunciationbot

Sends an audio file with the pronunciation of a word or phrase. Works in group chats.

For those who want to increase their vocabulary of English words, the bot offers a game of guessing the translation of English words. There are six different levels, statistics of correct/wrong answers and the possibility of reverse play (translation from Russian to English).

Cooking

With him, the question will not arise: “What to cook today?” You open the refrigerator, shovel everything into a pile and list the ingredients to the bot. He will select several recipes, and you just have to choose the one you like! Well, if you don’t know the recipe for a dish, then MyCookBot will give you the recipe for the dish you need.

Work with text

Checks the literacy of the text. If you add this bot to the general chat, it will point out the mistakes of each participant in the discussion.

Corrects text with a layout error - Russian to English or vice versa.

Synthesizes text into speech and vice versa.

For convenient work with Telegram

Creates an anonymous chat with the user's real nickname replaced with a fictitious one. For particularly secretive representatives.

Gatekeeper bot for general chat: welcomes new members, says goodbye to departing ones. You can set the text of his remarks yourself.

Counts chat message statistics.

Works with channels: can send formatted messages and create scheduled posts.

Shows data from Google Analytics.

Search for flights

Searches for flights: offers the fastest and cheapest options. Settings for the desired departure time or airline are available.

@aviasalesofficialbot

A bot from Aviasales searches for air tickets and hotels.

Yandex Maps

Works with Yandex maps - finds and shows objects, reports the level of traffic jams in the city.

Search for restaurants and cafes

Finds restaurants and cafes within a one kilometer radius of you. Shows their location, price tag, contacts, photos of the place and reviews about it. Works in the mobile client.

Shows five currently open bars within a kilometer radius of you.

For traveling

For those who are terrified of air travel. He will tell you which flight is safer for your route, and whether you can safely board this or that plane.

@osmbot OpenStreetMap

It can search for places all over the world, sends images in several formats to choose from, and provides contacts of stores in cities and towns from the service database. Speaks English.

@cargolinkbenzinbot

Shows gas stations within a radius of five kilometers from you. Works throughout the CIS.

Sports bots

Helps you buy or sell your gym membership. Works throughout Russia.

Sends a CrossFit training program for the day, records the result and compares it with the achievements of other athletes.

For business

Allows you to request extracts from the Unified State Register of Legal Entities about legal entities and information about their founders.

Allows you to set tasks for the team and yourself. A convenient tool for monitoring current affairs.

Traffic police fines

Checks whether there are traffic fines, saves the vehicle details, and reports the receipt of new fines. Unfortunately, you cannot pay the fine using it, but the bot provides a link to payment outside of Telegram.

Traffic rules exam

Exam for knowledge of traffic rules in the form of a bot. The database contains 40 tickets for 20 questions relevant for 2016.

Mobile phone

Determines the region and mobile operator by phone number.

Water marks

Places watermarks on photos and videos. You can customize the sign as text or a picture.

Password generator

@easystrongpasswordbot

Password generator - creates both complex and simple passwords so that you can easily remember them.

Search for interlocutors

Finds interlocutors around your location. The minimum search radius is 10 meters, the maximum audience is the whole world. It can be used, for example, at conferences or lectures, if you want to know the opinions of colleagues. The service is also quite suitable for meeting people in bars.

Heads and tails

Flips a coin for you in case of important decisions.

We offer development of bots for telegrams. To order a telegram bot for business, send your request by email [email protected].

We write /start to him and get a list of all his commands.
The first and main one - /newbot - we send it to him and the bot asks him to come up with a name for our new bot. The only restriction on the name is that it must end in “bot”. If successful, BotFather returns the bot token and a link to quickly add the bot to your contacts, otherwise you will have to rack your brains over the name.

This is already enough to get started. Those who are especially pedantic can already assign an avatar, description and welcome message to the bot here.

Don't forget to check the received token using the link api.telegram.org/bot /getMe , they say, doesn’t always work the first time.

2. Programming

I will create the bot in Python3, however, due to the adequacy of this language, the algorithms can be easily transferred to any other.

Telegram allows you not to upload messages manually, but to install a webHook, and then they will send each message themselves. For Python, in order not to bother with cgi and threads, it is convenient to use some kind of reactor, so I chose tornado.web for implementation. (for GAE it is convenient to use the Python2+Flask combination)

Bot frame:

URL = "https://api.telegram.org/bot%s/" % BOT_TOKEN MyURL = "https://example.com/hook" api = requests.Session() application = tornado.web.Application([ ( r"/", Handler), ]) if __name__ == "__main__": signal.signal(signal.SIGTERM, signal_term_handler) try: set_hook = api.get(URL + "setWebhook?url=%s" % MyURL) if set_hook.status_code != 200: logging.error("Can"t set hook: %s. Quit." % set_hook.text) exit(1) application.listen(8888) tornado.ioloop.IOLoop.current().start () except KeyboardInterrupt: signal_term_handler(signal.SIGTERM, None)
Here, when starting the bot, we install a webhook at our address and catch the exit signal in order to return the behavior with manual unloading of events.

The tornado application for processing requests accepts the tornado.web.RequestHandler class, which will contain the bot logic.

Class Handler(tornado.web.RequestHandler): def post(self): try: logging.debug("Got request: %s" % self.request.body) update = tornado.escape.json_decode(self.request.body) message = update["message"] text = message.get("text") if text: logging.info("MESSAGE\t%s\t%s" % (message["chat"]["id"], text)) if text == "/": command, *arguments = text.split(" ", 1) response = CMD.get(command, not_found)(arguments, message) logging.info("REPLY\t%s \t%s" % (message["chat"]["id"], response)) send_reply(response) except Exception as e: logging.warning(str(e))
Here CMD is a dictionary of available commands, and send_reply is a function for sending a response, which takes an already generated Message object as input.

Actually, its code is quite simple:

Def send_reply(response): if "text" in response: api.post(URL + "sendMessage", data=response)

Now that all the logic of the bot is described, you can start coming up with commands for it.

3. Teams

First of all, you need to follow the Telegram convention and teach the bot two commands: /start and /help:

Def help_message(arguments, message): response = ("chat_id": message["chat"]["id"]) result = ["Hey, %s!" % message["from"].get("first_name"), "\rI can accept only these commands:"] for command in CMD: result.append(command) response["text"] = "\n\t" .join(result) return response

The message["from"] structure is an object of type User , it provides the bot with information about both the user id and his name. For replies, it is more useful to use message["chat"]["id"] - in the case of personal communication there will be a User, and in the case of a chat - the chat id. Otherwise, you can get a situation where the user writes in the chat, and the bot responds in a personal message.

The /start command without parameters is intended to display information about the bot, and with parameters it is intended for identification. It is useful to use it for actions that require authorization.

After this, you can add some of your own commands, for example /base64:

Def base64_decode(arguments, message): response = ("chat_id": message["chat"]["id"]) try: response["text"] = b64decode(" ".join(arguments).encode("utf8 ")) except: response["text"] = "Can"t decode it" finally: return response

For mobile Telegram users, it will be useful to tell @BotFather what commands our bot accepts:
I: /setcommands
BotFather: Choose a bot to change the list of commands.
I: @******_bot
BotFather: OK. Send me a list of commands for your bot. Please use this format:

Command1 - Description
command2 - Another description
I:
whoisyourdaddy - Information about author
base64 - Base64 decode
BotFather: Success! Command list updated. /help

With this description, if the user types /, Telegram will helpfully show a list of all available commands.

4. Freedom

As you can see, Telegram sends the entire message, not split, and the restriction that commands begin with a slash is only for the convenience of mobile users. Thanks to this, you can teach the bot to speak a little humanly.

UPD: As they correctly suggested, this will only happen through personal communication. In chats, only messages starting with the command (/ ) (https://core.telegram.org/bots#privacy-mode)

For the bot to receive all messages in groups, write the @BotFather command /setprivacy and turn off privacy.

First, add a handler to Handler:

If text == "/": ... else: response = CMD[" "](message) logging.info("REPLY\t%s\t%s" % (message["chat"]["id"], response)) send_reply(response)
And then we add pseudo-speech to the list of commands:

RESPONSES = ( "Hello": ["Hi there!", "Hi!", "Welcome!", "Hello, (name)!"], "Hi there": ["Hello!", "Hello, (name) )!", "Hi!", "Welcome!"], "Hi!": ["Hi there!", "Hello, (name)!", "Welcome!", "Hello!"], "Welcome" : ["Hi there!", "Hi!", "Hello!", "Hello, (name)!",], ) def human_response(message): leven = fuzzywuzzy.process.extract(message.get("text ", ""), RESPONSES.keys(), limit=1) response = ("chat_id": message["chat"]["id"]) if leven< 75: response["text"] = "I can not understand you" else: response["text"] = random.choice(RESPONSES.get(leven)).format_map({"name": message["from"].get("first_name", "")}) return response
Here, the empirical constant 75 reflects relatively well the probability that the user actually wanted to say. And format_map is convenient for the same description of strings both requiring substitution and without it. Now the bot will respond to greetings and sometimes even call you by name.

5. Not text.

Bots, like any normal Telegram user, can not only write messages, but also share pictures, music, and stickers.

For example, let's expand the RESPONSES dictionary:

RESPONSES["What time is it?"] = [" ", "(date) UTC"]
And we will catch the text :

If response["text"] == " ": response["sticker"] = "BQADAgADeAcAAlOx9wOjY2jpAAHq9DUC" del response["text"]
It can be seen that now the Message structure no longer contains text, so it is necessary to modify send_reply:

Def send_reply(response): if "sticker" in response: api.post(URL + "sendSticker", data=response) elif "text" in response: api.post(URL + "sendMessage", data=response)
And that’s it, now the bot will occasionally send a sticker instead of the time:

6. Opportunities

Thanks to the convenience of the API and quick start, Telegram bots can become a good platform for automating their actions, setting up notifications, creating quizzes and task-based competitions (CTF, DozoR and others).

Looking back, I can say that now there are fewer perversions, and the work is more transparent.

7. Limitations

Unfortunately, at the moment there is a limitation on the use of webHook - it only works over https and only with a valid certificate, which, for example, is still critical for me due to the lack of support for dynamic DNS by certification authorities.

Fortunately, Telegram can also work with manual updates, so without changing the code, you can create another Puller service that will download them and send them to a local address:

While True: r = requests.get(URL + "?offset=%s" % (last + 1)) if r.status_code == 200: for message in r.json()["result"]: last = int (message["update_id"]) requests.post("http://localhost:8888/", data=json.dumps(message), headers=("Content-type": "application/json", "Accept" : "text/plain")) else: logging.warning("FAIL " + r.text) time.sleep(3)

P.S. Regarding point 7, I found a convenient solution - hosting the bot not at home, but on Heroku, since all names like *.herokuapp.com are protected by their own certificate.

UPD: Telegram has improved the Bot Api, which is why it is no longer necessary to have a separate function for sending messages when a webhook is installed, and in response to a POST request you can respond with the same generated JSON with a response message, where one of the fields is set as h "method ": "sendMessage" (or any other method used by the bot).