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:
parent
2add34c702
commit
d26923e167
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user