From 5807ed7b926742fdb643da07b0f0116d70957aeb Mon Sep 17 00:00:00 2001 From: neko259 Date: Tue, 15 Jan 2019 22:45:45 +0200 Subject: [PATCH] Fail if token is not specified --- init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 2b4c3b3..ac1eb0a 100644 --- a/init.lua +++ b/init.lua @@ -6,6 +6,10 @@ local telegram = {} local token = minetest.settings:get("telegram.token") local chat_id = minetest.settings:get("telegram.chatid") +if not token then + error("Bot token should be specified in the config in order to work.") +end + local UPDATES_TIMEOUT = 1 -- seconds local UPDATES_LIMIT = 10 @@ -16,9 +20,9 @@ local ie, req_ie = _G, minetest.request_insecure_environment if req_ie then ie = req_ie() end if not ie then - error("The mod requires access to insecure functions in order ".. - "to work. Please add the mod to your secure.trusted_mods ".. - "setting or disable the mod.") + error("The mod requires access to insecure functions in order ".. + "to work. Please add the mod to your secure.trusted_mods ".. + "setting or disable the mod.") end ie.package.path = ie.package.path