did stuff
This commit is contained in:
parent
6655f1fc32
commit
44291686ad
@ -57,8 +57,16 @@ local function getTutelServer()
|
|||||||
return readFileOneline("/brulijam/config/tutelServer.txt")
|
return readFileOneline("/brulijam/config/tutelServer.txt")
|
||||||
end
|
end
|
||||||
|
|
||||||
function telegramNotifier()
|
function getTelegramInfo()
|
||||||
http.post()
|
return textutils.unserialize(basic.readFileAll("brulijam/config/telegram.config"))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--https://seals.social/minecraftapi
|
||||||
|
function telegramNotifier(message)
|
||||||
|
local tutelServer = getTutelServer()
|
||||||
|
local telegramInfo = getTelegramInfo()
|
||||||
|
http.post(tutelServer .. "/telegramBot/sendMessage/" .. telegramInfo["telegramUserId"] .. "?accessToken=" .. telegramInfo["telegramUserToken"], message)
|
||||||
end
|
end
|
||||||
|
|
||||||
function splitStringToArray(inputStr)
|
function splitStringToArray(inputStr)
|
||||||
|
@ -29,7 +29,7 @@ local copyList = {
|
|||||||
[21] = "/brulijam/tutelMoveTest.lua",
|
[21] = "/brulijam/tutelMoveTest.lua",
|
||||||
[22] = "/brulijam/files/shape-hex-64-10.svg",
|
[22] = "/brulijam/files/shape-hex-64-10.svg",
|
||||||
[23] = "/brulijam/schmutz.lua",
|
[23] = "/brulijam/schmutz.lua",
|
||||||
|
[24] = "/brulijam/telegram-setup.lua",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
11
src/brulijam/telegram-setup.lua
Normal file
11
src/brulijam/telegram-setup.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
basic = require("lib.basic")
|
||||||
|
|
||||||
|
local tutelServer = basic.readFileOneline("brulijam/config/tutelServer.txt")
|
||||||
|
local telegramCredentials = {}
|
||||||
|
|
||||||
|
write("User ID: ")
|
||||||
|
telegramCredentials["telegramUserId"] = read()
|
||||||
|
write("Account Token: ")
|
||||||
|
telegramCredentials["telegramUserToken"] = read("*")
|
||||||
|
|
||||||
|
basic.writeToFile("brulijam/config/telegram.config", textutils.serialize(telegramCredentials))
|
Loading…
Reference in New Issue
Block a user