Hi there, I sucessfully used node-red-contrib-telegrambot with a bot created via BotFather, to send and receive messages. So usually I send texts that are interpreted as commands and I generate answers using the initial ChatID.
Now I "just" want to enable a friend that uses Telegram too, to do just the same instead me - so how to get this easiest - is it something I or he need to do in Telegram or in node-red?
So far i have a function to fill the answer like
var as=global.get('Alarm');
let payload = {
"chatId":111111111,
"type":"message",
"content": "Status "+n+":\n\nAlarm="+as"
};
return {payload};
You may want to create a Telegram group and join to this group your new bot and your friend. As a second step send a message to the group. Now you have to find what is the chatid of the group you just created. You can do that by entering the following URL in your browser: https://api.telegram.org/bot(enter here theToken of your bot - without the parenthesis)/getUpdates
You will get in your browser a JSON object that has inside a chatID with a negative sign. A fake example below.
Instead of a group, you could also get your friend to add your bot to their account - then they can do the same as you. In Node-RED you would see messages from a different chatid.
But a group works as well, but really that is for if you want both of you to see the inputs and outputs.
yes, also my friend did so and I see his messages in the group, but not with "getUpdates" - maybe my phone eats the update before I can hit F5 in the browser?