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

Merge pull request #1193 from Badiboy/master

Raise exception if no token passed
This commit is contained in:
Badiboy 2021-06-19 15:10:32 +03:00 committed by GitHub
commit ab6d40a072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,8 @@ def _make_request(token, method_name, method='get', params=None, files=None):
:param files: Optional files. :param files: Optional files.
:return: The result parsed to a JSON dictionary. :return: The result parsed to a JSON dictionary.
""" """
if not token:
raise Exception('Bot token is not defined')
if API_URL: if API_URL:
request_url = API_URL.format(token, method_name) request_url = API_URL.format(token, method_name)
else: else: