Skip to content
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

Document Soundboard #6260

Merged
merged 23 commits into from
Sep 20, 2024
Merged

Document Soundboard #6260

merged 23 commits into from
Sep 20, 2024

Conversation

advaith1
Copy link
Contributor

@advaith1 advaith1 commented Jun 28, 2023

Documents soundboard sounds and management. When a soundboard sound is used, Voice Channel Effect Send is emitted, which is documented in #6025

airhorn sounds intensify

some notes:

  • Bots cannot use soundboard
  • Looks like GUILD_SOUNDBOARD_SOUND_CREATE, GUILD_SOUNDBOARD_SOUND_UPDATE, and GUILD_SOUNDBOARD_SOUND_DELETE are not tied to any intent currently, so they are sent to all bots
    • They should probably be tied to GUILD_EMOJIS_AND_STICKERS (1 << 3), which should be renamed to GUILD_EXPRESSIONS
  • There is no GET route for individual sounds or a guild's list of sounds. Guild sound lists can currently only be retrieved via the Gateway. GET routes should be added
  • PATCHing a sound currently clears the sound's volume and emoji if those aren't included in the request.
    • The PR documents this current behavior, let me know once it is fixed
  • Looks like id and sound_id are always the same, but id is optional id is deprecated, removed from docs

edit: fixed all of these :)

| emoji_id | ?snowflake | the id of this sound's custom emoji |
| emoji_name | ?string | the unicode character of this sound's standard emoji |
| override_path | ?string | the filename of this sound (for default sounds) |
| guild_id? | snowflake | the id of the guild this sound is in |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| guild_id? | snowflake | the id of the guild this sound is in |
| guild_id? | snowflake | the id of the guild this sound belongs to |

docs/resources/Soundboard.md Outdated Show resolved Hide resolved

Users can play soundboard sounds in voice channels, triggering a Voice Channel Effect Send Gateway event for users connected to the voice channel. Bots cannot play soundboard sounds. Soundboard use is controlled by the `USE_SOUNDBOARD` and `USE_EXTERNAL_SOUNDS` [permissions](#DOCS_TOPICS_PERMISSIONS).

There is a set of [default sounds](#DOCS_RESOURCES_SOUNDBOARD/list-soundboard-default-sounds) available to all users. Soundboard sounds can also be [created in a guild](#DOCS_RESOURCES_SOUNDBOARD/create-guild-soundboard-sound); users will be able to use the sounds in the guild, and Nitro subscribers can use them in all guilds.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
There is a set of [default sounds](#DOCS_RESOURCES_SOUNDBOARD/list-soundboard-default-sounds) available to all users. Soundboard sounds can also be [created in a guild](#DOCS_RESOURCES_SOUNDBOARD/create-guild-soundboard-sound); users will be able to use the sounds in the guild, and Nitro subscribers can use them in all guilds.
There is a set of [default sounds](#DOCS_RESOURCES_SOUNDBOARD/list-soundboard-default-sounds) available to all users. Soundboard sounds can also be [created in a guild](#DOCS_RESOURCES_SOUNDBOARD/create-guild-soundboard-sound); users will be able to use the sounds in this guild, and Nitro subscribers can use them in any guild.

docs/resources/Soundboard.md Outdated Show resolved Hide resolved
docs/resources/Soundboard.md Outdated Show resolved Hide resolved
docs/resources/Soundboard.md Outdated Show resolved Hide resolved
| Field | Type | Description |
| ------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------- |
| name | string | the name of this sound |
| sound_id | snowflake | the id of this sound |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| sound_id | snowflake | the id of this sound |
| sound_id | snowflake | the id of this [sound](#DOCS_RESOURCES_SOUNDBOARD/sound-files) |

docs/resources/Soundboard.md Outdated Show resolved Hide resolved
| available? | boolean | whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts |
| user? | [user](#DOCS_RESOURCES_USER/user-object) object | the user who created this sound |

### Sound Files
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe that could be integrated into the reference section somehow, since that's the only place where CDN endpoints are currently listed...

Co-authored-by: Valle <bluetiger.bahnfan@gmail.com>
@cobaltt7
Copy link

is there a status on this?

@MinnDevelopment
Copy link
Contributor

What is holding this back?

@codeofandrin
Copy link
Contributor

What is holding this back?

Maybe the conflicts

@codeofandrin
Copy link
Contributor

override_path doesn't exist anymore. For default sounds the /soundboard-sounds/sound_id is used as well for the CDN path. E.g. https://cdn.discordapp.com/soundboard-sounds/7 is the "ba dum tss" sound.
Also, there's no format. Means, if you download it you have to change the format yourself in order to play the sound, looks like this is not intended.

@codeofandrin
Copy link
Contributor

soundboard_sounds field is available in the Guild Create event. Has to be added to the extra fields: https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields

@codeofandrin
Copy link
Contributor

The SOUNDBOARD_SOUNDS event is missing in the receive events list.

@bsian03 bsian03 mentioned this pull request Jan 17, 2024
55 tasks
@colinloretz colinloretz self-assigned this May 13, 2024
@colinloretz colinloretz self-requested a review May 14, 2024 20:44
@advaith1
Copy link
Contributor Author

advaith1 commented Jul 29, 2024

heads up we are removing the user_id field on soundboard sounds. you will still get user if you have Manage Expressions

@codeofandrin
Copy link
Contributor

GET /guilds/{guild_id}/soundboard-sounds and GET /guilds/{guild_id}/soundboard-sounds/{sound_id} are missing.

/guilds/{guild_id}/soundboard-sounds returns items which is a list of sound objects:

{
    "items": [
        {
            "available": true,
            "emoji_id": null,
            ...
        },
        ...
    ]
}

@advaith1
Copy link
Contributor Author

advaith1 commented Aug 6, 2024

yeah I made those endpoints last week and didn't update the pr yet because there are some other things we are changing

@codeofandrin
Copy link
Contributor

heads up we are removing the user_id field on soundboard sounds. you will still get user if you have Manage Expressions

user_id is still sent instead of user in the GUILD_CREATE event. Will this also be changed?

@advaith1
Copy link
Contributor Author

advaith1 commented Aug 7, 2024

I think we will only send the user field over API and gateway will eventually not include user data, like emoji and stickers

codeofandrin

This comment was marked as resolved.

Copy link
Contributor

@codeofandrin codeofandrin left a comment

Choose a reason for hiding this comment

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

Typos + add information when CREATE_GUILD_EXPRESSIONS perm is sufficient in get soundboard sounds.

docs/resources/Soundboard.md Outdated Show resolved Hide resolved
docs/resources/Soundboard.md Show resolved Hide resolved
| Field | Type | Description |
|------------|-------------------------------------------------|---------------------------------------------------------------------------|
| name | string | the name of this sound |
| sound_id | snowflake | the id of this sound |
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it sound_id instead of id like for other snowflake objects?

Copy link
Contributor

Choose a reason for hiding this comment

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

there used to be an id field, they got rid of it and perhaps didn't see a point in breaking and changing the name

Copy link
Contributor

@colinloretz colinloretz left a comment

Choose a reason for hiding this comment

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

🎁 🚀

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.

8 participants