only attach reference message if not already known
parent
5af89811be
commit
bc573dfd52
|
@ -103,15 +103,15 @@ async def on_message(message):
|
||||||
if reference := message.reference:
|
if reference := message.reference:
|
||||||
if session := load_session(message.reference):
|
if session := load_session(message.reference):
|
||||||
context = session.get('context', [])
|
context = session.get('context', [])
|
||||||
|
else:
|
||||||
reference_message = await message.channel.fetch_message(
|
reference_message = await message.channel.fetch_message(
|
||||||
reference.message_id)
|
reference.message_id)
|
||||||
reference_content = reference_message.content
|
reference_content = reference_message.content
|
||||||
raw_content = '\n'.join([
|
raw_content = '\n'.join([
|
||||||
raw_content,
|
raw_content,
|
||||||
'Use it to answer the prompt:',
|
'Use it to answer the prompt:',
|
||||||
reference_content,
|
reference_content,
|
||||||
])
|
])
|
||||||
|
|
||||||
async for buffer, chunk in buffered_generate_response(
|
async for buffer, chunk in buffered_generate_response(
|
||||||
raw_content,
|
raw_content,
|
||||||
|
|
Loading…
Reference in New Issue