@@ -256,22 +256,8 @@ export async function preflightDiscordMessage(
256256
257257 const pluralkitConfig = params . discordConfig ?. pluralkit ;
258258 const webhookId = resolveDiscordWebhookId ( message ) ;
259- const shouldCheckPluralKit = Boolean ( pluralkitConfig ?. enabled ) ;
260259 let pluralkitInfo : Awaited < ReturnType < typeof fetchPluralKitMessageInfo > > = null ;
261- if ( shouldCheckPluralKit ) {
262- try {
263- pluralkitInfo = await fetchPluralKitMessageInfo ( {
264- messageId : message . id ,
265- config : pluralkitConfig ,
266- } ) ;
267- if ( isPreflightAborted ( params . abortSignal ) ) {
268- return null ;
269- }
270- } catch ( err ) {
271- logVerbose ( `discord: pluralkit lookup failed for ${ message . id } : ${ String ( err ) } ` ) ;
272- }
273- }
274- const sender = resolveDiscordSenderIdentity ( {
260+ let sender = resolveDiscordSenderIdentity ( {
275261 author,
276262 member : params . data . member ,
277263 pluralkitInfo,
@@ -480,6 +466,26 @@ export async function preflightDiscordMessage(
480466 logVerbose ( `discord: drop bound-thread webhook echo message ${ message . id } ` ) ;
481467 return null ;
482468 }
469+
470+ if ( pluralkitConfig ?. enabled ) {
471+ try {
472+ pluralkitInfo = await fetchPluralKitMessageInfo ( {
473+ messageId : message . id ,
474+ config : pluralkitConfig ,
475+ } ) ;
476+ if ( isPreflightAborted ( params . abortSignal ) ) {
477+ return null ;
478+ }
479+ sender = resolveDiscordSenderIdentity ( {
480+ author,
481+ member : params . data . member ,
482+ pluralkitInfo,
483+ } ) ;
484+ } catch ( err ) {
485+ logVerbose ( `discord: pluralkit lookup failed for ${ message . id } : ${ String ( err ) } ` ) ;
486+ }
487+ }
488+
483489 const boundSessionKey = conversationRuntime . isPluginOwnedSessionBindingRecord ( threadBinding )
484490 ? ""
485491 : threadBinding ?. targetSessionKey ?. trim ( ) ;
0 commit comments