@usepipa/pipa 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.mjs +4 -1
package/package.json
CHANGED
package/src/app.mjs
CHANGED
|
@@ -165,7 +165,10 @@ export async function startPipa(options = {}) {
|
|
|
165
165
|
|
|
166
166
|
const handle = async (thread, message, subscribe) => {
|
|
167
167
|
if (!accepting || !isAuthorized(thread, message, config) || shouldIgnore(thread, message)) return;
|
|
168
|
-
const
|
|
168
|
+
const messageText = subscribe || message.isMention ? stripMention(message.text) : message.text.trim();
|
|
169
|
+
const missingLinks = (message.links ?? []).map((link) => link.url)
|
|
170
|
+
.filter((url) => typeof url === "string" && !messageText.split(/\s+/u).includes(url));
|
|
171
|
+
const prompt = missingLinks.length ? `${messageText}\n\nFull links:\n${[...new Set(missingLinks)].join("\n")}` : messageText;
|
|
169
172
|
if (!prompt) return;
|
|
170
173
|
const attachments = message.attachments ?? [];
|
|
171
174
|
if (subscribe) await thread.subscribe();
|