Skip to content

fix(rank): remove invalid AttachmentBuilder.build() crashing /rank info#106

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-c072
Draft

fix(rank): remove invalid AttachmentBuilder.build() crashing /rank info#106
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-c072

Conversation

@cursor

@cursor cursor Bot commented Jun 1, 2026

Copy link
Copy Markdown

Bug and impact

Every /rank info invocation crashed after the rank card was generated with:

TypeError: (intermediate value).build is not a function

Users could never view rank cards.

Root cause

rank.js called new AttachmentBuilder(data, { name: "rank.png" }).build(), but discord.js v14's AttachmentBuilder has no .build() method (unlike canvacord's Rank.build()).

Fix

Pass the AttachmentBuilder instance directly in the files array.

Validation

  • npm test (39 tests, including new tests/rank-attachment.test.js)
  • Reproduced the crash locally with AttachmentBuilder(...).build() before the fix
Open in Web View Automation 

discord.js v14 AttachmentBuilder has no .build() method. Calling it
throws TypeError and breaks every /rank info invocation after the card
is generated.

Co-authored-by: zVapor_ <contact@zvapor.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant