From d7d1ad99dd9e15f4cf530aacf658db85a152d678 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 3 Dec 2020 07:55:29 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20error=20if=20the=20specifi?= =?UTF-8?q?ed=20bot=20token=20is=20invalid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core.py b/core.py index 981b9cc..ecacbcd 100644 --- a/core.py +++ b/core.py @@ -88,9 +88,8 @@ def main(): # Test the specified token log.debug("Testing bot token...") - try: - me = bot.get_me() - except telegram.error.Unauthorized: + me = bot.get_me() + if me is None: logging.fatal("The token you have entered in the config file is invalid. Fix it, then restart greed.") sys.exit(1) log.debug("Bot token is valid!")