did stuff

This commit is contained in:
Julian Brammer 2024-07-02 15:21:04 +02:00
parent ac1a6a2a91
commit 63c01d8a0e

View File

@ -53,7 +53,7 @@ function ntfy(msg)
http.post(getNtfyAddress(), "[" .. os.getComputerLabel() .. "] " .. msg) http.post(getNtfyAddress(), "[" .. os.getComputerLabel() .. "] " .. msg)
end end
local function getTutelServer() local function getTutelServerAddress()
return readFileOneline("/brulijam/config/tutelServer.txt") return readFileOneline("/brulijam/config/tutelServer.txt")
end end
@ -64,11 +64,17 @@ end
--https://seals.social/minecraftapi --https://seals.social/minecraftapi
function telegramNotifier(message) function telegramNotifier(message)
local tutelServer = getTutelServer() local tutelServer = getTutelServerAddress()
local telegramInfo = getTelegramInfo() local telegramInfo = getTelegramInfo()
http.post(tutelServer .. "/telegramBot/sendMessage/" .. telegramInfo["telegramUserId"] .. "?accessToken=" .. telegramInfo["telegramUserToken"], message) http.post(tutelServer .. "/telegramBot/sendMessage/" .. telegramInfo["telegramUserId"] .. "?accessToken=" .. telegramInfo["telegramUserToken"], message)
end end
function addTutelToTutelServer()
local tutelServer = getTutelServerAddress()
local telegramInfo = getTelegramInfo()
http.post(tutelServer .. "/tutel/add?label=" .. os.getComputerLabel .. "&telegramUserId=" .. telegramInfo["telegramUserId"])
end
function splitStringToArray(inputStr) function splitStringToArray(inputStr)
table = {} table = {}
i = 0 i = 0