From 4d3eb3ea7fd51e9245913683cfcacc56e9cf3fd3 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sat, 2 Mar 2019 19:32:48 +0400 Subject: [PATCH] Fail if Telegram API ID or API Hash empty --- internal/telegram/telegram.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/telegram/telegram.go b/internal/telegram/telegram.go index b03084b..e024d4c 100644 --- a/internal/telegram/telegram.go +++ b/internal/telegram/telegram.go @@ -14,6 +14,14 @@ import ( // At first launch we need to login manually - there is no way to automate // Telegram login func Authenticate() { + if c.Config.TDLib.APIHash == "" { + log.Error().Msg("APIHash is empty") + return + } + if c.Config.TDLib.APIID == "" { + log.Error().Msg("APIID is empty") + return + } tdlib.SetLogVerbosityLevel(1) tdlib.SetFilePath(c.Config.TDLib.ErrorsFile)