MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / processMessage

Function processMessage

apps/web/services/channels/userJoined.ts:65–78  ·  view source on GitHub ↗
(body: string, displayName: string)

Source from the content-addressed store, hash-verified

63}
64
65export function processMessage(body: string, displayName: string) {
66 let split = body.split('`');
67 if (split.length === 3) {
68 body += ` Also, \`${displayName}\` joined.`;
69 } else {
70 let init = split.splice(0, 3).join('`');
71 let joined = split.filter(
72 (t) => t !== ' and ' && t !== ', ' && t !== ' joined.'
73 );
74 const result = `\`${joined.join('`, `')}\` and \`${displayName}\` joined.`;
75 body = init.concat(result);
76 }
77 return body;
78}
79
80async function createThread({
81 body,

Callers 2

userJoined.test.tsFile · 0.90
notifyChannelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected