- By submitting this appeal, you confirm that:
- - You are the original creator or authorized representative of the
- content in question. - Your appeal is submitted in good faith and
- aligns with bitvid’s policies. - You understand that final
- decisions are at the discretion of bitvid’s moderation process.
+ By submitting this appeal, you confirm that:
+ - You are the original creator or authorized representative of the
+ content in question.
+ - Your appeal is submitted in good faith and aligns with bitvid’s
+ policies.
+ - You understand that final decisions are at the discretion of bitvid’s
+ moderation process.
@@ -175,7 +186,7 @@
signEvent,
nip04,
relayInit,
- } from "https://cdn.jsdelivr.net/npm/nostr-tools/+esm";
+ } from "https://cdn.jsdelivr.net/npm/nostr-tools@1.14.1/+esm";
// ---- Configure target npubs and relays here ----
const targetNpubs = [
@@ -209,13 +220,10 @@
const ephemeralPrivKey = generatePrivateKey();
const ephemeralPubKeyHex = getPublicKey(ephemeralPrivKey);
- // Convert form data to a text block (or JSON string if you prefer)
+ // Convert form data to JSON
const formText = JSON.stringify(dataObject, null, 2);
- // For each target npub:
- // 1) Convert to hex
- // 2) Encrypt the form data with ephemeral key
- // 3) Create and publish an event to each relay
+ // Send to each target
for (const npub of targetNpubs) {
try {
const decoded = nip19.decode(npub);
@@ -249,6 +257,7 @@
// Publish to configured relays
for (const relayUrl of Object.keys(relays)) {
const relay = relayInit(relayUrl);
+
relay.on("connect", () => {
console.log(`Connected to ${relayUrl}`);
});
@@ -266,7 +275,7 @@
console.error(`Failed to publish to ${relayUrl}:`, reason);
});
- // Close the relay after a short delay or after publish
+ // Close the relay after a short delay
setTimeout(() => {
relay.close();
}, 3000);
@@ -276,7 +285,7 @@
}
}
- // (Optional) Clear or reset the form
+ // Optional: reset the form
form.reset();
alert("Your appeal has been submitted via Nostr DMs.");
});