-
Notifications
You must be signed in to change notification settings - Fork 15
Initialize
Luca edited this page Dec 30, 2023
·
1 revision
The function _Telegram_Init
checks if a provided token is not empty or null. If it's empty or null, it sets an error flag. Then it saves the provided token, forms a URL based on some base URL and the provided token, and optionally validates the token if the $bValidate
parameter is set to True.
If validation is requested, it calls _Telegram_GetMe()
to retrieve data and ensures that the returned data is in JSON object format. If there's an error during validation or the data isn't in JSON object format, it returns an error.
Finally, it returns True
if everything is successful or False
if there's an issue with the token or the validation process.