01.06.2020, 14:29
It was explained here https://forum.logicmachine.net/showthrea...13#pid2513 but lets make a clear version:
1. Install Telegram app
2. Find BotFather or go here https://t.me/botfather
3. Once in BotFather type /newbot and follow instructions. As a result you will get your token and your own bot link like t.me/yourname_bot Click on the link and type any message there
4. Open browser (preferably Firefox as it converts JSON automatically) and go here https://api.telegram.org/bot<token>/getUpdates. Replace <token> with your token. As a result you should have something like that. Save your chat ID
5. Create a user library called telegram. paste this code and replace your token and chat ID
6. Create an event based script and use this code to send message to Telegram app:
1. Install Telegram app
2. Find BotFather or go here https://t.me/botfather
3. Once in BotFather type /newbot and follow instructions. As a result you will get your token and your own bot link like t.me/yourname_bot Click on the link and type any message there
4. Open browser (preferably Firefox as it converts JSON automatically) and go here https://api.telegram.org/bot<token>/getUpdates. Replace <token> with your token. As a result you should have something like that. Save your chat ID
5. Create a user library called telegram. paste this code and replace your token and chat ID
Code:
require('ssl.https')
local token = 'token' -- your token
local chat_id = '1234567' -- your chat id
function telegram(message)
local url = 'https://api.telegram.org/bot' .. token .. '/sendMessage'
local data = 'chat_id=' .. chat_id .. '&text=' .. socket.url.escape(message)
return ssl.https.request(url, data)
end
6. Create an event based script and use this code to send message to Telegram app:
Code:
require("user.telegram")
message = 'test message'
res, err = telegram(message)
log(res, err)
------------------------------
Ctrl+F5
Ctrl+F5