INNER CODE UNIT · Python
send_proofreading_result_in_dm
seratch/ChatGPT-in-Slack · app/bolt_listeners.py:751
def send_proofreading_result_in_dm(
body: dict,
client: WebClient,
context: BoltContext,
logger: logging.Logger,
):
view = body["view"]
view_blocks = view["blocks"]
if view_blocks is None or len(view_blocks) == 0:
return
try:
result = view_blocks[1].get("text", {}).get("text")
if result is not None:
client.chat_postMessage(
channel=context.actor_user_id,
text=":wave: Here is the proofreading result:\n" + result,
)
# Remove the last block that displays the button