Skip to content

Commit 3085635

Browse files
authoredDec 16, 2024··
Merge pull request #1125 from azep-ninja/fix/discord-duplicats-fix
fix: discord client duplicate function removal
2 parents 969812e + c596959 commit 3085635

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed
 

‎packages/client-discord/src/messages.ts

+1-42
Original file line numberDiff line numberDiff line change
@@ -687,47 +687,6 @@ export class MessageManager {
687687
);
688688
}
689689

690-
private _isMessageForMe(message: DiscordMessage): boolean {
691-
const isMentioned = message.mentions.users?.has(
692-
this.client.user?.id as string
693-
);
694-
const guild = message.guild;
695-
const member = guild?.members.cache.get(this.client.user?.id as string);
696-
const nickname = member?.nickname;
697-
698-
// Don't consider role mentions as direct mentions
699-
const hasRoleMentionOnly =
700-
message.mentions.roles.size > 0 && !isMentioned;
701-
702-
// If it's only a role mention and we're in team mode, let team logic handle it
703-
if (
704-
hasRoleMentionOnly &&
705-
this.runtime.character.clientConfig?.discord?.isPartOfTeam
706-
) {
707-
return false;
708-
}
709-
710-
return (
711-
isMentioned ||
712-
(!this.runtime.character.clientConfig?.discord
713-
?.shouldRespondOnlyToMentions &&
714-
(message.content
715-
.toLowerCase()
716-
.includes(
717-
this.client.user?.username.toLowerCase() as string
718-
) ||
719-
message.content
720-
.toLowerCase()
721-
.includes(
722-
this.client.user?.tag.toLowerCase() as string
723-
) ||
724-
(nickname &&
725-
message.content
726-
.toLowerCase()
727-
.includes(nickname.toLowerCase()))))
728-
);
729-
}
730-
731690
private async _analyzeContextSimilarity(
732691
currentMessage: string,
733692
previousContext?: MessageContext,
@@ -1218,7 +1177,7 @@ export class MessageManager {
12181177
return false;
12191178
}
12201179
}
1221-
1180+
12221181
if (message.mentions.has(this.client.user?.id as string)) return true;
12231182

12241183
const guild = message.guild;

0 commit comments

Comments
 (0)
Please sign in to comment.