From e72c3abd7fdac2dd2c4a01c23fc8881212c649ad Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Thu, 5 Mar 2026 23:46:35 -0800 Subject: [PATCH] Correct sender name and use non-deprecated loop getter --- app/fanout/bot.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/fanout/bot.py b/app/fanout/bot.py index f46ea25..36c49e9 100644 --- a/app/fanout/bot.py +++ b/app/fanout/bot.py @@ -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(