INNER CODE UNIT · Python
respond_to_app_mention
seratch/ChatGPT-in-Slack · app/bolt_listeners.py:97
def respond_to_app_mention(
context: BoltContext,
payload: dict,
client: WebClient,
logger: logging.Logger,
):
thread_ts = payload.get("thread_ts")
if thread_ts is not None:
parent_message = find_parent_message(client, context.channel_id, thread_ts)
if parent_message is not None and is_this_app_mentioned(
context, parent_message
):
# The message event handler will reply to this
return
wip_reply = None
# Replace placeholder for Slack user ID in the system prompt
system_text = build_system_text(SYSTEM_TEXT, TRANSLATE_MARKDOWN, context)