telegram groups?

florin215 years ago

i dont know if this is way to complex and so on

lets say i got 3 groups and on each there are 2 gps
i want to have 3 notification bots that go to 3 different channels and 3 different groups of people

is this posible?

Tony Shelver5 years ago

I don't think your use case is clear enough. Even when Traccar implements event notifications to Telegram it should work the same way that the current SMS, email and web notifications work. That is sending messages to specific 'users'. You can define dummy users to send to a specific email address or group or whatever.

We created a custom Telegram notification bot. We also decided to not use channels / groups, as if you have a lot of endpoints to send messages to, the manual configuration and maintenance of those takes too much time, unless you control all Telegram accounts in the system.
Instead we created a self-registration process for users. Not terribly difficult.

florin215 years ago

I don't think your use case is clear enough

afaik telegram sends everything to one channel / group, afaik in the current version i cant have 3 different telegram bots for 3 different channels / groups

Macan5 years ago

Tony,

How its possible that users get also notifications for the events on they telegram via my bot?

Tony Shelver5 years ago

We created our own telegram messaging facility (python with the telegram and telegram.ext libraries), and then monitored the events.
My background is more Python and SQL than Java (my last in-depth java use was back in 2000...), and there are a LOT of libraries available for Python, so that is the route we took.

Note that we implemented our own authentication / user management tables for the Telegram / reporting app.
Where we are likely different to you, is that we have more than one tracking application to monitor (Traccar and an OEM system we bought some years ago).

Our process is:
User installs Telegram
User searches and adds our bot
User sends a registration request for access to a relevant tracking user / group, using a known fact.
Our telegram bot app then authorises the user against the relevant vehicles and for a given set of events, storing the chat_id as the user key along with Telegram user's first / last name and username.
The user can then review the vehicle and granted / available messages, and modify the messages they wish to be notified of.
From then on we monitor the events and send event notifications to relevant Telegram accounts.

Our telegram front end does a lot more than just messaging: it allows the user to request statuses (stati...) for all vehicles, as well as extract several group reports to Telegram in Excel file format. We have extracted the relevant tracking data to our own reporting database for reporting purposes.

Many of our user's don't go into the tracking web app at all, they just use Telegram on the device they have with them.

We have spent a lot of time on optimising both the database and the Telegram bot (python) back end due to the amount of use we are placing on it.
As a result, even big reports like trips and stops for several vehicles over a month take only seconds to run, especially if we have cached the location addresses or have set up permanent user / customer locations manually.

Likely we will modify the Telegram over time for better UI (maybe using the inline keyboard / messaging), but for now it's fast and functional,

If you decide to go this route, get me your contact details and I can give you some of our learning points.

Tony Shelver5 years ago

Also you probably want to just use 1 bot. The users have to search and authorize your bot to send messages, so having more than 1 is just confusing.
We originally tried using channels or groups, but that was a pain to set up and administer, hence the current user self-registration mechanism.

Macan4 years ago

That is very good, can you make some tutorial for the community, that would be great if you can!

Best regards