bot.py
def _make_request(token, method_name, params=None):

        """Makes a request to the Telegram API.
        :param token: The bot's API token. (Created with @BotFather)
        :param method_name: Name of the API method to be called. (E.g. 'getUpdates')
        :param method: HTTP method to be used. Defaults to 'get'.
        :return: The result parsed to a JSON dictionary.
        """
       
        request_url = "https://api.telegram.org/bot{0}/{1}".format(token, method_name)
        try:
            result = requests.get(request_url,params=params)
            got_result = True
        except :
            logger.debug("Timeout Error on {0} method ".format(method_name))
        logger.debug("The server returned: '{0}'".format(result.text.encode('utf8')))
        
        json_result = result.json()
        if json_result["ok"]:
            return json_result['result']
        else:
            json_result['result']=0
            return json_result['result']
Makes a request to the Telegram API.
        :param token: The bot's API token. (Created with @BotFather)
        :param method_name: Name of the API method to be called. (E.g. 'getUpdates')
        :param method: HTTP method to be used. Defaults to 'get'.
        :return: The result parsed to a JSON dictionary.
        
Makes a request to the Telegram API.
Makes a request to the Telegram API .
def _make_request(token, method_name, params=None):
        request_url = "https://api.telegram.org/bot{0}/{1}".format(token, method_name)
        try:
            result = requests.get(request_url,params=params)
            got_result = True
        except :
            logger.debug("Timeout Error on {0} method ".format(method_name))
        logger.debug("The server returned: '{0}'".format(result.text.encode('utf8')))
        json_result = result.json()
        if json_result["ok"]:
            return json_result['result']
        else:
            json_result['result']=0
            return json_result['result']
def _make_request ( token , method_name , params = None ) : request_url = "https://api.telegram.org/bot{0}/{1}" . format ( token , method_name ) try : result = requests . get ( request_url , params = params ) got_result = True except : logger . debug ( "Timeout Error on {0} method " . format ( method_name ) ) logger . debug ( "The server returned: '{0}'" . format ( result . text . encode ( 'utf8' ) ) ) json_result = result . json ( ) if json_result [ "ok" ] : return json_result [ 'result' ] else : json_result [ 'result' ] = 0 return json_result [ 'result' ]
Makes a request to the Telegram API.
Makes a request to the Telegram API .
"""Makes a request to the Telegram API.
        :param token: The bot's API token. (Created with @BotFather)
        :param method_name: Name of the API method to be called. (E.g. 'getUpdates')
        :param method: HTTP method to be used. Defaults to 'get'.
        :return: The result parsed to a JSON dictionary.
        """
The result parsed to a JSON dictionary.
The result parsed to a JSON dictionary .
token
The bot's API token. (Created with @BotFather)
The bot ' s API token . ( Created with @BotFather )
method_name
Name of the API method to be called.
Name of the API method to be called .
params
method
HTTP method to be used. Defaults to 'get'.
HTTP method to be used . Defaults to ' get ' .