Skip to content

Commit 90be9ec

Browse files
committed
fix: remove unused variable
1 parent c56f60c commit 90be9ec

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

packages/client-discord/src/messages.ts

+29-9
Original file line numberDiff line numberDiff line change
@@ -508,24 +508,44 @@ export class MessageManager {
508508
}
509509

510510
private _isMessageForMe(message: DiscordMessage): boolean {
511-
const isMentioned = message.mentions.users?.has(this.client.user?.id as string);
511+
const isMentioned = message.mentions.users?.has(
512+
this.client.user?.id as string
513+
);
512514
const guild = message.guild;
513515
const member = guild?.members.cache.get(this.client.user?.id as string);
514516
const nickname = member?.nickname;
515-
const memberId = member?.id;
516517

517518
// Don't consider role mentions as direct mentions
518-
const hasRoleMentionOnly = message.mentions.roles.size > 0 && !isMentioned;
519+
const hasRoleMentionOnly =
520+
message.mentions.roles.size > 0 && !isMentioned;
519521

520522
// If it's only a role mention and we're in team mode, let team logic handle it
521-
if (hasRoleMentionOnly && this.runtime.character.clientConfig?.discord?.isPartOfTeam) {
523+
if (
524+
hasRoleMentionOnly &&
525+
this.runtime.character.clientConfig?.discord?.isPartOfTeam
526+
) {
522527
return false;
523528
}
524529

525-
return isMentioned || (!this.runtime.character.clientConfig?.discord?.shouldRespondOnlyToMentions && (
526-
message.content.toLowerCase().includes(this.client.user?.username.toLowerCase() as string) ||
527-
message.content.toLowerCase().includes(this.client.user?.tag.toLowerCase() as string) ||
528-
(nickname && message.content.toLowerCase().includes(nickname.toLowerCase()))));
530+
return (
531+
isMentioned ||
532+
(!this.runtime.character.clientConfig?.discord
533+
?.shouldRespondOnlyToMentions &&
534+
(message.content
535+
.toLowerCase()
536+
.includes(
537+
this.client.user?.username.toLowerCase() as string
538+
) ||
539+
message.content
540+
.toLowerCase()
541+
.includes(
542+
this.client.user?.tag.toLowerCase() as string
543+
) ||
544+
(nickname &&
545+
message.content
546+
.toLowerCase()
547+
.includes(nickname.toLowerCase()))))
548+
);
529549
}
530550

531551
async processMessageMedia(
@@ -1287,4 +1307,4 @@ export class MessageManager {
12871307
const data = await response.json();
12881308
return data.username;
12891309
}
1290-
}
1310+
}

0 commit comments

Comments
 (0)