This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Telegram group
#1
Hi community,
I need to create telegram company group where send LM5 notifications. Someone has already done?
My will it is send event notifications simultaneously at 10 users.
I already thanks all can help me.
Best regards Cristian
Reply
#2
(03.08.2024, 15:19)CristianAgata Wrote: Hi community,
I need to create telegram company group where send LM5 notifications. Someone has already done?
My will it is send event notifications simultaneously at 10 users.
I already thanks all can help me.
Best regards Cristian

A little update, i've reached to do that...... The only thing it is thst I don't know how..... I've done done something without understand why  Huh Huh Huh
If someone have a guide he is welcome.
have a good weekend.
BR Cristian
Reply
#3
Hi Cristian,

not sure about company (business??) telegram account, but you can send info to many telegram users, but only one can send commands to LM:

https://forum.logicmachine.net/showthread.php?tid=4692

And look this for telegram usage, hope it helps you:

https://forum.logicmachine.net/showthrea...7#pid29437

Alex
Reply
#4
(03.08.2024, 17:38)AlexLV Wrote: Hi Cristian,

not sure about company (business??) telegram account, but you can send info to many telegram users, but only one can send commands to LM:

https://forum.logicmachine.net/showthread.php?tid=4692

And look this for telegram usage, hope it helps you:

https://forum.logicmachine.net/showthrea...7#pid29437

Alex

Hi Alex,
Thanks for your answer, what I have to do it is a little bit different. A LM5 must send via telegram all the notification event to many users (a telegram group in my case) and the client as administrator can add or remove users. 
Anyway I reach and it works fine. As fast as possible I will post a list of operation as configure.
BR Cristian
Reply
#5
For groups, when looking for chat id using getUpdates API call find chat where type is supergroup. Note that chat id can start with a minus (negative number).
If sending messages is not working then check the API response, point nr.6 here: https://kb.logicmachine.net/notifications/telegram/
Reply
#6
Hi,
is possible more in detail describe how to find new created group ID? In same places I also found that bot should be added into new group. Also I open web telegram, try to find group id there. With group ID I taken from web telegram message was not sent. Log:

* arg: 1
* string: {"ok":false,"error_code":400,"description":"Bad Request: chat not found"}
* arg: 2
* number: 400
BR, Alex
Reply
#7
You must add your bot to the group first.
Reply
#8
Hi, I add my existing bot into new group, when trying send command message, I see such log:

* arg: 1
* string: receive error
* arg: 2
* string: error:0A000126:SSL routines::unexpected eof while reading

from resident tgread script:

function callback(text, userid, username)
log(text, userid, username)
if (text == "AlexOn") then
grp.write('0/2/3', 1)
end
if (text == "AlexOff") then
grp.write('0/2/3', 0)
end
if (text == "TeraseOn") then
grp.write('0/4/4', 1)
end
if (text == "TeraseOff") then
grp.write('0/4/4', 0)
end
end

token = 'here my token'
require('user.tgupdates')(token, callback)

What I did wrong? Of course I changed group id to new, Also I see incoming messages from SL in group, I receive error in SL when trying to send command message from group

Alex
Reply
#9
Strange, but today suddenly begin to work.. No any changes from my side was done.. (Telegram side??)

So steps:
1. Create new tg group.
2. Add members to tg group.
3. Add your bot to group. I also added bot to admins of group and gave access to messages.
4. Send message into your group.
5. Using getUpdates API call find chat where type is supergroup. (https://kb.logicmachine.net/notifications/telegram/ p.4)
6. Change chat_id to taken from supergroup in user.telegram library (Scripting --> User libraries)
7. Test it. Smile Now my SL receiving commands from any user in my tg group and do it.

Alex
Reply


Forum Jump: