affaan-m/ECC · error · Error

Discord announcement credentials are missing or invalid

Error message

Discord announcement credentials are missing or invalid

What it means

deliver validates Discord credentials (bot token and announce channel id) before sending; they are absent or rejected, so no announcement can be posted. This guard also covers the channel lookup returning unusable data.

Source

Thrown at scripts/discord/release-announce.mjs:183

    const response = await request(webhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload),
    });
    if (!response.ok) {
      await deleteReceiptComment(claimId);
      throw new Error(`Discord webhook request failed (${response.status})`);
    }
    const message = await response.json();
    await addReceiptComment(discussion.id, `${marker}\n\nDiscord delivery: complete (message ${message.id}).`);
    await deleteReceiptComment(claimId).catch(() => {
      console.warn('announcement delivered; pending receipt cleanup requires attention');
    });
    console.log('announcement delivered by channel webhook');
    return;
  }
  if (!env.DISCORD_BOT_TOKEN || !/^\d{10,25}$/.test(env.DISCORD_ANNOUNCE_CHANNEL_ID || '')) {
    throw new Error('Discord announcement credentials are missing or invalid');
  }
  const recent = await discord('GET', `/channels/${env.DISCORD_ANNOUNCE_CHANNEL_ID}/messages?limit=100`);
  const receipt = findDiscordReceipt(recent, key);
  if (receipt) {
    await discord('PUT', `/channels/${env.DISCORD_ANNOUNCE_CHANNEL_ID}/pins/${receipt.id}`);
    console.log('announcement already delivered; pin verified');
    return;
  }
  const message = await discord('POST', `/channels/${env.DISCORD_ANNOUNCE_CHANNEL_ID}/messages`, buildDiscordPayload({
    title: discussion.title,
    body: discussion.body,
    url: discussion.url,
    key,
  }));
  await discord('PUT', `/channels/${env.DISCORD_ANNOUNCE_CHANNEL_ID}/pins/${message.id}`);
  console.log('announcement delivered and pinned');
}

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Provide valid credentials/configuration or wait for the rate-limit reset; verify permissions/role.
Defensive patterns

Strategy: validation

When it happens

Trigger: Triggered when release-announce.mjs rejects the current invocation: Discord announcement credentials are missing or invalid

Common situations: Occurs while running scripts/discord/release-announce.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/release-announce.mjs:183 aborts the command with this message.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/6042b1ec305363c5. Report an issue: GitHub.