I tried telegram bot to receive data from a private and group chat but I don't get anything, I can only interpret the data from the bot I created but not within the chat. Am I wrong or is it not possible?
Sorry, not quite clear what your issue is. Certainly you can get information to your bot in a group chat or in a 1:1 chat.
I try to explain myself better: I'm interested in knowing if this contrib node-red-contrib-telegrambot (node) - Node-RED, (or similar) receives data only from the bot telegram or also from the group or private chat of telegram, since I do not receive them in chat, instead with the bot I have no problems I receive and send data
It only receives from the bot. In the group, a group user needs to interact with the bot.
However, you can also have the bot listen to all messages in a group. Then everything that happens in the group will appear as an inbound msg.
The one limitation is that you cannot have 2 bots in a group talking to each other. If one bot posts to a group, the other bot cannot receive that message.
That's exactly what I need but how should it be configured? I added user (with or without @) and ChatIds in nodered bot configuration, but nothing happens
My configuratios:
If I use : https://api.telegram.org/bot1630910881:AAF-ovtOhFzZPLCqwHBW7jpJYOEphdVt3Ug/sendMessage?chat_id=-597556680&text=test
the message appears correctly in telegram but nodered does not receive any message
If you go into your group, click on the icon to get into the groups config. Then you can see who is a member of the group. Check if the bot has access to messages - if it doesn't it can only receive /
commands, you need to change the bot's privacy settings for the group using the BotFather group.
Details here: How to receive messages in group chats using telegram bot api - Stack Overflow - if privacy is set to enabled
, only /
commands will get to the bot, if disabled, all messages can get to it.
Note that all bots in the group will get commands and/or messages and all can respond.
To respond to a message/command, in Node-RED add a telegram receiver node then optionally a switch to filter out what you want to respond to, a simple response could simply replace the msg.payload.content of the incoming msg and then send to a telegram sender node.
For more complex responses, try using the RiveScript contrib node or maybe a custom function.
Here are some examples I have in my setup:
The link nodes all go back to a single sender.
Here is an older config using RiveScript to allow for a more conversational interaction:
Output on this one goes via MQTT.
First of all thank you for the suggestions, I have configured the privacy and group messages are now active but unfortunately nodered receives data from the chat app only and not from the api command line, I have to use a shortcut of siri to give the commands and so it is unusable, I will look for some alternative, thank you very much anyway
I don't understand. That's the first time you've mentioned that. Which API and how are you using it?
The issue I think you have is that bots cannot interact with other bots. If you are using Apple Shortcuts, I think that Telegram treats any interactions like another bot. There is an outstanding enhancement request iOS 12 Shortcuts and iOS URL Scheme support · Issue #309 · peter-iakovlev/Telegram (github.com).
Apple iOS is not good at these kinds of complex interactions.
You probably didn't notice but the link I showed you, used the "telegram bot api".
Anyway I would have liked to activate a gpio from siri,someone had suggested telegram but probably it is not the most suitable method
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.