|
1 |
| -import { composeContext } from "@elizaos/core"; |
| 1 | +import { composeContext, composeRandomUser } from "@elizaos/core"; |
2 | 2 | import { generateMessageResponse, generateShouldRespond } from "@elizaos/core";
|
3 | 3 | import {
|
4 | 4 | Content,
|
@@ -507,8 +507,6 @@ export class MessageManager {
|
507 | 507 | }
|
508 | 508 | }
|
509 | 509 |
|
510 |
| -<<<<<<< HEAD |
511 |
| -<<<<<<< HEAD |
512 | 510 | private _isMessageForMe(message: DiscordMessage): boolean {
|
513 | 511 | const isMentioned = message.mentions.users?.has(
|
514 | 512 | this.client.user?.id as string
|
@@ -550,31 +548,6 @@ export class MessageManager {
|
550 | 548 | );
|
551 | 549 | }
|
552 | 550 |
|
553 |
| -======= |
554 |
| ->>>>>>> b04fe69e (gitbook data fetch.) |
555 |
| -======= |
556 |
| - private _isMessageForMe(message: DiscordMessage): boolean { |
557 |
| - const isMentioned = message.mentions.users?.has(this.client.user?.id as string); |
558 |
| - const guild = message.guild; |
559 |
| - const member = guild?.members.cache.get(this.client.user?.id as string); |
560 |
| - const nickname = member?.nickname; |
561 |
| - const memberId = member?.id; |
562 |
| - |
563 |
| - // Don't consider role mentions as direct mentions |
564 |
| - const hasRoleMentionOnly = message.mentions.roles.size > 0 && !isMentioned; |
565 |
| - |
566 |
| - // If it's only a role mention and we're in team mode, let team logic handle it |
567 |
| - if (hasRoleMentionOnly && this.runtime.character.clientConfig?.discord?.isPartOfTeam) { |
568 |
| - return false; |
569 |
| - } |
570 |
| - |
571 |
| - return isMentioned || (!this.runtime.character.clientConfig?.discord?.shouldRespondOnlyToMentions && ( |
572 |
| - message.content.toLowerCase().includes(this.client.user?.username.toLowerCase() as string) || |
573 |
| - message.content.toLowerCase().includes(this.client.user?.tag.toLowerCase() as string) || |
574 |
| - (nickname && message.content.toLowerCase().includes(nickname.toLowerCase())))); |
575 |
| - } |
576 |
| - |
577 |
| ->>>>>>> 4ec26576 (fix mismatch.) |
578 | 551 | async processMessageMedia(
|
579 | 552 | message: DiscordMessage
|
580 | 553 | ): Promise<{ processedContent: string; attachments: Media[] }> {
|
@@ -1255,7 +1228,7 @@ export class MessageManager {
|
1255 | 1228 | this.runtime.character.templates
|
1256 | 1229 | ?.discordShouldRespondTemplate ||
|
1257 | 1230 | this.runtime.character.templates?.shouldRespondTemplate ||
|
1258 |
| - discordShouldRespondTemplate, |
| 1231 | + composeRandomUser(discordShouldRespondTemplate, 2), |
1259 | 1232 | });
|
1260 | 1233 |
|
1261 | 1234 | const response = await generateShouldRespond({
|
|
0 commit comments