Awakari in Telegram

Awakari in Telegram

In the previous article, I talked about Avakari – a reverse search system in the message stream. Since then, some time has passed to run in the system and add new functions. Finally, it’s time to integrate with Telegram, making it easy for ordinary people to use Avakari for their needs.

What is Awakari?

The most important thing about Avakar is this subscription (Subscription). With the help of a subscription, the user defines search criteria among messages. But instead of repeating the search for new messages, in Avakar, new messages trigger a search for subscriptions. After that, the system delivers messages to all subscriptions. This approach allows you to avoid polling and deliver messages to users immediately.

For this, the so-called Reverse Search Index is used in addition to the usual Publish/Subscribe functionality.

Data sources

Suppose Avakari knows how to filter information efficiently. But where do Avakari receive new messages from? In theory, you can use anything, mass media, messengers, social networks, messages from all kinds of smart devices. Right now there are already two ways – news feeds in RSS/Atom format and public channels in Telegram.

RSS

At the moment, the system receives updates from 43 popular news feeds. There is science, news, Khabr itself (where is it without it), finance, movie reviews, updates of popular YouTube channels in different languages ​​and much more.

The list is easily updated and suggestions for new sources are readily accepted. So, if you know of an interesting RSS/Atom feed, please send it to the author. Or you can immediately offer a Pull Request here: https://github.com/awakari/producer-rss/tree/master/helm/producer-rss/templates (there is an up-to-date full list of current news feeds used at the entrance) .

Public Telegram channels

The integration with Telegram for Avakari is obvious. Therefore, the system also receives messages from some popular and public Telegram channels. By analogy with news feeds, there is also science, jobs around the world, news, various products, movie announcements, cryptocurrencies, Arabic, Korean, Hindi… Total 38 channels at the time of writing. Suggestions for additions are also welcome. The current list is here: https://github.com/awakari/producer-telegram/blob/master/helm/producer-telegram/values-demo-0.yaml

Telegram bot

Telegram bot @AwakariBot is the main user interface. It allows you to manage your subscriptions, post your own messages to the system, and most importantly, read messages from your subscriptions. Available functions are divided into two categories:

  1. Private chat with bot – manage subscriptions and publish messages.

  2. Group with a bot – choosing a subscription (or several) to read messages in this group.

To get started with the bot, start with a private chat and simply click the “START” button.

Private chat

It looks like this:

The main functions are available as buttons at the bottom.

Subscriptions button – for obtaining subscription usage statistics. Also sends a list of all user subscriptions. Each subscription in the list is also a button, clicking on which displays detailed information about the selected subscription and offers action buttons:

The + Basic button under Subscriptions allows you to quickly create the simplest subscription with a text condition for messages. When clicked, the bot offers to enter the name of the new subscription and a list of keywords (everything is separated by spaces, so the name of the new subscription should not contain spaces, like the keywords). Example:

The subscription from this example will receive all messages that contain at least one of the words “news”, “news” or “uutiset”. For English will also work in different cases, numbers, etc. (Stemming). Stemming is not yet available for other languages, but may be possible in the future.

The “+ Custom” button under “Subscriptions” can be useful for creating complex subscriptions with grouping of conditions and relationships between them (And/Or/Xor). There are also numerical conditions in this mode. More about it here: https://awakari.app/help.html

By analogy with subscriptions, under the Messages Publishing button there are buttons such as ▸ Basic and ▸ Custom. These are buttons for sending a simple message and a message with arbitrary attributes, respectively. In sending a simple message, you can also send an image/photo, audio/music, video or document:

A group with a bot

OK, I’ve subscribed to get what I’m interested in, what’s next?

Next, you need to create a group and invite AwakariBot to it. You can call it something like “Awakari Inbox” (for example, for all subscriptions at once) or give a name that corresponds to one subscription. The bot will prompt you to select a subscription from the list to read. You can choose several. When the system receives a message that matches this subscription, the robot will send it to this group:

Another example of a received message is from an RSS feed. Such messages contain additional attributes hidden under the spoiler under “Extra Attributes”:

Plans for the future

All this is now actively used for personal needs. Also available to everyone else under smart and in demo mode. If it turns out to be useful to someone else, then it will be possible to translate all this into a mode of real use aka production.

Speech recognition

The most obvious extension is speech recognition. The user sends a voice message through the bot, the bot using the Speech API converts it into text (transcript) and the message becomes easily available for comparison with text terms.

It is also possible to pass messages with images or videos through the classifier, so that those users who want to receive only photos of red cats can always receive them.

Exchange rates and cryptocurrencies

Monitoring of (crypto)currency rates and notifications based on arbitrary conditions such as “dollar over 100” may also be of interest to certain categories of users.

That’s it for today. If you have any questions, you can use the bot command /support or ask a question in a collective group in Telegram.

If you look events in Mykolaiv – https://city-afisha.com/afisha/

Related posts