-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add soundboard #10590
base: main
Are you sure you want to change the base?
feat: add soundboard #10590
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
bb9d6a6
to
2ef1a3a
Compare
2ef1a3a
to
57c2a7c
Compare
This comment has been minimized.
This comment has been minimized.
57c2a7c
to
7821166
Compare
f3031c1
to
55725d0
Compare
55725d0
to
ce7db7f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10590 +/- ##
==========================================
- Coverage 39.15% 39.12% -0.03%
==========================================
Files 244 244
Lines 14804 14797 -7
Branches 1413 1414 +1
==========================================
- Hits 5796 5789 -7
Misses 8996 8996
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
830929a
to
1e0fb55
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
1e0fb55
to
1931f6e
Compare
1931f6e
to
b61e513
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth to add a get soundboardSound()
to
this.soundId = data.sound_id ?? null; |
this.guild.soundboardSounds.cache
.
async create({ emojiId, emojiName, file, name, reason, volume }) { | ||
const resolvedFile = await resolveFile(file); | ||
|
||
const sound = resolveBase64(resolvedFile.data, 'audio/mp3'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this support both mp3
and ogg
based on the file type, not hardcoded to mp3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try:
- Take it as a required parameter from the user (I wouldn't go this route)
userParam ?? resolvedFile.contentType ?? lazilyLoadedMagicBytesLib()
packages/discord.js/src/managers/GuildSoundboardSoundManager.js
Outdated
Show resolved
Hide resolved
if ('emoji_id' in data) { | ||
/** | ||
* The emoji id of the soundboard sound | ||
* @type {?Snowflake} | ||
*/ | ||
this.emojiId = data.emoji_id; | ||
} else { | ||
this.emojiId ??= null; | ||
} | ||
|
||
if ('emoji_name' in data) { | ||
/** | ||
* The emoji name of the soundboard sound | ||
* @type {?string} | ||
*/ | ||
this.emojiName = data.emoji_name; | ||
} else { | ||
this.emojiName ??= null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not saying this so you change it, but I will call out that we should think if we wanna do emojis properly and use the emoji class instead of Discord's inconsistent handling of emojis across different objects.
|
||
/** | ||
* Send a soundboard sound to a voice channel the user is connected to. | ||
* Fires a Voice Channel Effect Send Gateway event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a tag for this: @fires
Please describe the changes this PR makes and why it should be merged:
Adds soundboard for mainlib
Status and versioning classification: