Skip to content

Conversation

@AsadHumayun
Copy link
Contributor

This PR will add the SoundboardSound API structure, as documented on the Discord API documentation here.

This PR does not add tests for this structure.

Thanks to @edocsil47 for helping on how to determine if a guild id is present within the structure.

Mentioning #10981 for visibility.

@vercel
Copy link

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
discord-js Skipped Skipped Jan 27, 2026 11:07pm
discord-js-guide Skipped Skipped Jan 27, 2026 11:07pm

Request Review

@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 22, 2026 00:06 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 22, 2026 00:06 Inactive
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.75%. Comparing base (1251d47) to head (2549103).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ages/structures/src/soundboards/SoundboardSound.ts 0.00% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11390      +/-   ##
==========================================
- Coverage   31.80%   31.75%   -0.06%     
==========================================
  Files         380      381       +1     
  Lines       13838    13860      +22     
  Branches     1093     1095       +2     
==========================================
  Hits         4401     4401              
- Misses       9303     9325      +22     
  Partials      134      134              
Flag Coverage Δ
structures 37.18% <0.00%> (-0.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a new soundboards module to the structures package by creating a SoundboardSound class that wraps Discord API soundboard data, and exposing it through public re-exports at both module and package levels.

Changes

Cohort / File(s) Summary
Soundboards Module
packages/structures/src/soundboards/SoundboardSound.ts, packages/structures/src/soundboards/index.ts, packages/structures/src/index.ts
Introduces SoundboardSound<Omitted> class extending Structure<APISoundboardSound, Omitted> with public accessors for name, soundId, volume, emojiId, emojiName, guildId, and available. Includes computed properties for createdTimestamp (derived from DiscordSnowflake when guild_id present) and createdAt (Date or null). Exposes new class through module and package-level re-exports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the SoundboardSound structure to the packages/structures module.
Description check ✅ Passed The description is clearly related to the changeset, explaining what SoundboardSound is, referencing the Discord API documentation, and acknowledging contributors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/structures/src/soundboards/SoundboardSound.ts`:
- Around line 22-27: Update the JSDoc on the SoundboardSound constructor: change
the `@param` description that currently says "The raw data received from the API
for the emoji" to "The raw data received from the API for the soundboard sound"
(parameter is the constructor public constructor(data:
Partialize<APISoundboardSound, Omitted>) in class SoundboardSound) so the doc
correctly describes the data type and intent.
- Around line 78-95: The guild check in the createdTimestamp getter is overly
verbose and casts unnecessarily; update createdTimestamp (accessing
this[kData].sound_id and this[kData].guild_id) to determine inGuild with a
simple Boolean(this[kData].guild_id) and call DiscordSnowflake.timestampFrom
with the sound_id directly (remove the unnecessary "as string" cast), leaving
createdAt to continue returning new Date(timestamp) or null as before.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0171769 and 7b2225b.

📒 Files selected for processing (3)
  • packages/structures/src/index.ts
  • packages/structures/src/soundboards/SoundboardSound.ts
  • packages/structures/src/soundboards/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Tests
🔇 Additional comments (4)
packages/structures/src/soundboards/SoundboardSound.ts (2)

1-6: LGTM!

Imports are appropriate - using @sapphire/snowflake for timestamp extraction and proper types from discord-api-types/v10.


29-76: LGTM!

The getters correctly map API fields to properties following the established pattern in this codebase. The naming conventions (camelCase for JS, snake_case access to raw data) are consistent.

packages/structures/src/soundboards/index.ts (1)

1-1: LGTM!

Standard barrel export following the established pattern in this codebase.

packages/structures/src/index.ts (1)

9-9: LGTM!

The soundboards module export is correctly placed in alphabetical order and follows the established barrel export pattern.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@vercel vercel bot temporarily deployed to Preview – discord-js January 22, 2026 00:16 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 22, 2026 00:16 Inactive
Qjuh
Qjuh previously requested changes Jan 23, 2026
@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Jan 23, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 09:33 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 23, 2026 09:33 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 23, 2026 09:41 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 09:41 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 24, 2026 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 24, 2026 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 24, 2026 16:41 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 24, 2026 16:41 Inactive
@almeidx almeidx requested a review from Qjuh January 24, 2026 17:29
@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Jan 27, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js January 27, 2026 23:07 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 27, 2026 23:07 Inactive
@kodiakhq kodiakhq bot merged commit 6538603 into discordjs:main Jan 27, 2026
16 checks passed
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants