Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local botToken = "YOUR_BOT_TOKEN"
- local chatId = "CHAT_ID" -- Or user ID
- local message = "Hello from ComputerCraft Lua!"
- local apiEndpoint = "https://api.telegram.org/bot" .. botToken .. "/sendMessage?chat_id=" .. chatId .. "&text=" .. message
- local response = http.get(apiEndpoint)
- if response then
- local responseData = response.readAll()
- response.close()
- print("Telegram API Response:")
- print(responseData)
- else
- print("Failed to send message.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement