1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Raise exception if no token passed

This commit is contained in:
Badiboy 2021-06-19 15:09:52 +03:00
parent 2add34c702
commit d26923e167

View File

@ -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: