INNER CODE UNIT · Python
respond
skyportal/skyportal · services/assistant/app.py:600
def respond(message_id):
session_context_id.set(uuid.uuid4().hex)
try:
with DBSession() as session:
message = session.scalar(
sa.select(AssistantMessage).where(AssistantMessage.id == message_id)
)
if message is None or message.system:
return
user_id = message.user_id
channel = message.channel
context_type, context_id = message.context_type, message.context_id
notify = message.notify
if already_answered(session, message):
log(f"message {message_id} already has an answer; not answering twice")
return
conversation = conversation_of(