From d26923e167e4ce324134bbdb117039890c874007 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Sat, 19 Jun 2021 15:09:52 +0300 Subject: [PATCH] Raise exception if no token passed --- telebot/apihelper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index a2f04b2..7a238e3 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -68,6 +68,8 @@ def _make_request(token, method_name, method='get', params=None, files=None): :param files: Optional files. :return: The result parsed to a JSON dictionary. """ + if not token: + raise Exception('Bot token is not defined') if API_URL: request_url = API_URL.format(token, method_name) else: