
























@@ -20,20 +20,23 @@ describe("collectDiscordStatusIssues", () => {
2020} as ChannelAccountSnapshot,
2121]);
222223-expect(issues).toEqual(
24-expect.arrayContaining([
25-expect.objectContaining({
26-channel: "discord",
27-accountId: "ops",
28-kind: "intent",
29-}),
30-expect.objectContaining({
31-channel: "discord",
32-accountId: "ops",
33-kind: "config",
34-}),
35-]),
36-);
23+expect(issues).toEqual([
24+{
25+channel: "discord",
26+accountId: "ops",
27+kind: "intent",
28+message: "Message Content Intent is disabled. Bot may not see normal channel messages.",
29+fix: "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation.",
30+},
31+{
32+channel: "discord",
33+accountId: "ops",
34+kind: "config",
35+message:
36+"Some configured guild channels are not numeric IDs (unresolvedChannels=2). Permission audit can only check numeric channel IDs.",
37+fix: "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe).",
38+},
39+]);
3740});
38413942it("reports channel permission failures with match metadata", () => {
@@ -57,15 +60,16 @@ describe("collectDiscordStatusIssues", () => {
5760} as ChannelAccountSnapshot,
5861]);
596260-expect(issues).toHaveLength(1);
61-expect(issues[0]).toMatchObject({
62-channel: "discord",
63-accountId: "ops",
64-kind: "permissions",
65-});
66-expect(issues[0]?.message).toContain("Channel 123 permission check failed");
67-expect(issues[0]?.message).toContain("alerts");
68-expect(issues[0]?.message).toContain("guilds.ops.channels");
63+expect(issues).toEqual([
64+{
65+channel: "discord",
66+accountId: "ops",
67+kind: "permissions",
68+message:
69+"Channel 123 permission check failed. missing ViewChannel, SendMessages: 403 (matchKey=alerts matchSource=guilds.ops.channels)",
70+fix: "Ensure the bot role can view + send in this channel (and that channel overrides don't deny it).",
71+},
72+]);
6973});
70747175it("reports degraded runtime transport state", () => {
@@ -81,12 +85,13 @@ describe("collectDiscordStatusIssues", () => {
8185]);
82868387expect(issues).toEqual([
84-expect.objectContaining({
88+{
8589channel: "discord",
8690accountId: "ops",
8791kind: "runtime",
88-message: expect.stringContaining("stale-socket"),
89-}),
92+message: "Discord gateway transport is degraded (stale-socket; account is running).",
93+fix: "Check gateway event-loop health and Discord connectivity, then restart the Discord channel or gateway if the transport does not recover.",
94+},
9095]);
9196});
9297});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。