Correct sender name and use non-deprecated loop getter

This commit is contained in:
Jack Kingsman
2026-03-05 23:46:35 -08:00
parent 439face70b
commit e72c3abd7f

View File

@@ -49,11 +49,14 @@ class BotModule(FanoutModule):
channel_key = None
channel_name = None
# Look up sender name from contacts
from app.repository import ContactRepository
# Outgoing DMs: sender is us, not the contact
if is_outgoing:
sender_name = None
else:
from app.repository import ContactRepository
contact = await ContactRepository.get_by_key(conversation_key)
sender_name = contact.name if contact else None
contact = await ContactRepository.get_by_key(conversation_key)
sender_name = contact.name if contact else None
else:
conversation_key = data.get("conversation_key", "")
sender_key = None
@@ -89,7 +92,7 @@ class BotModule(FanoutModule):
from app.fanout.bot_exec import _bot_executor, _bot_semaphore
async with _bot_semaphore:
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
try:
response = await asyncio.wait_for(
loop.run_in_executor(