chatbridge_telegram.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:hangoutsbot 作者: das7pad 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号