def telegram_api_request(self, configuration, method, data):
connector = aiohttp.TCPConnector(verify_ssl=True)
headers = {'content-type': 'application/x-www-form-urlencoded'}
BOT_API_KEY = configuration["bot_api_key"]
url = "https://api.telegram.org/bot{}/{}".format(BOT_API_KEY, method)
async with aiohttp.ClientSession() as session:
async with session.post(url, data=data, headers=headers, connector=connector) as response:
results = await response.text()
return results
评论列表
文章目录