import type { FeishuMessageEvent } from "./event-types.js";
export type { MentionTarget } from "./mention-target.types.js"; import type { MentionTarget } from "./mention-target.types.js"; import { isFeishuGroupChatType } from "./types.js";
if (isDirectMessage) { // DM: trigger if any non-bot user is mentioned return hasOtherMention;
} // Group: need to mention both bot and other users const hasBotMention = mentions.some((m) => m.id.open_id === botOpenId); return hasBotMention && hasOtherMention;
}
/** *Extractmessagebodyfromtext(remove@placeholders)
*/
export function extractMessageBody(text: string, allMentionKeys: string[]): string {
let result = text;
// Remove all @ placeholders for (const key of allMentionKeys) {
result = result.replace(new RegExp(escapeRegExp(key), "g"), "");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.