logging of webhook responses

This commit is contained in:
Tomáš Mládek 2021-02-27 09:47:58 +01:00
parent 808156f016
commit e8bfd02259

3
bot.py
View file

@ -56,12 +56,13 @@ def process_event(event, template):
async def send_message(text):
async with aiohttp.ClientSession() as session:
await session.post(config.WEBHOOK_URL, json={
result = await session.post(config.WEBHOOK_URL, json={
"text": text,
"format": "html",
"displayName": "PUBLIC INFORMATION STREAMS & SERVICES",
"avatarUrl": config.AVATAR_URL
})
logging.debug(f"RECV: [{result.status}] {await result.text()}")
async def main():