Better printing
This commit is contained in:
parent
b1d7642dce
commit
feb272aeb1
|
|
@ -4,6 +4,7 @@ import asyncio
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
from pprint import pprint
|
||||||
from typing import List, Any, AsyncGenerator, Dict, Coroutine, TypeVar
|
from typing import List, Any, AsyncGenerator, Dict, Coroutine, TypeVar
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
@ -110,7 +111,8 @@ class ClientWrapper(object):
|
||||||
# Get the payload
|
# Get the payload
|
||||||
post_params = await request.post()
|
post_params = await request.post()
|
||||||
payload = json.loads(post_params["payload"])
|
payload = json.loads(post_params["payload"])
|
||||||
print("Interaction received: {}".format(payload))
|
print("\nInteraction Event received:")
|
||||||
|
pprint(payload)
|
||||||
|
|
||||||
# Handle each action separately
|
# Handle each action separately
|
||||||
if "actions" in payload:
|
if "actions" in payload:
|
||||||
|
|
@ -140,6 +142,7 @@ class ClientWrapper(object):
|
||||||
# Respond that everything is fine
|
# Respond that everything is fine
|
||||||
return web.Response(status=200)
|
return web.Response(status=200)
|
||||||
else:
|
else:
|
||||||
|
print("\nMalformed event received.")
|
||||||
# If we can't read it, get mad
|
# If we can't read it, get mad
|
||||||
return web.Response(status=400)
|
return web.Response(status=400)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from pprint import pprint
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from typing import Optional, Generator, Callable, Union, Awaitable
|
from typing import Optional, Generator, Callable, Union, Awaitable
|
||||||
from typing import TypeVar
|
from typing import TypeVar
|
||||||
|
|
@ -158,7 +159,8 @@ def message_stream(slack: SlackClient) -> Generator[Event, None, None]:
|
||||||
|
|
||||||
# Handle each
|
# Handle each
|
||||||
for update in update_list:
|
for update in update_list:
|
||||||
print("Message received: {}".format(update))
|
print("\nRTM Message received:")
|
||||||
|
pprint(update)
|
||||||
yield message_dict_to_event(update)
|
yield message_dict_to_event(update)
|
||||||
|
|
||||||
except (SlackNotConnected, OSError) as e:
|
except (SlackNotConnected, OSError) as e:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue