def _send_to_external_chat(self, bot, event, config):
if event.from_bot:
# don't send my own messages
return
conversation_id = event.conv_id
conversation_text = event.text
user_id = event.user_id
url = config["HUBOT_URL"] + conversation_id
payload = {"from" : str(user_id.chat_id), "message" : conversation_text}
headers = {'content-type': 'application/json'}
connector = aiohttp.TCPConnector(verify_ssl=False)
asyncio.ensure_future(
aiohttp.request('post', url, data=json.dumps(payload),
headers=headers, connector=connector)
)
评论列表
文章目录