diff --git a/src/langbot/pkg/pipeline/preproc/preproc.py b/src/langbot/pkg/pipeline/preproc/preproc.py index 28b2fefb..4525d526 100644 --- a/src/langbot/pkg/pipeline/preproc/preproc.py +++ b/src/langbot/pkg/pipeline/preproc/preproc.py @@ -77,9 +77,7 @@ class PreProcessor(stage.PipelineStage): # Extract sender name from message event sender_name = '' - if isinstance(query.message_event, platform_events.FriendMessage): - sender_name = query.message_event.sender.get_name() - elif isinstance(query.message_event, platform_events.GroupMessage): + if isinstance(query.message_event, (platform_events.FriendMessage, platform_events.GroupMessage)): sender_name = query.message_event.sender.get_name() variables = {