-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 voice messages. #6082
Document voice messages. #6082
Conversation
docs/resources/Channel.md
Outdated
| height? | ?integer | height of file (if image) | | ||
| width? | ?integer | width of file (if image) | | ||
| ephemeral? \* | boolean | whether this attachment is ephemeral | | ||
| duration_secs? | integer | the duration of the audio file (currently for voice messages) | |
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.
| duration_secs? | integer | the duration of the audio file (currently for voice messages) | | |
| duration_secs? | float | the duration of the audio file (currently for voice messages) | |
duration_secs
should be a float
:
"content_type": "audio/ogg",
"duration_secs": 1.2999999523162842,
Seems to be not the case. That should be all (referencing my own implementation of voice messages). |
Shouldn't this also document the {
"message": "Cannot send voice messages in this channel",
"code": 50173
} |
docs/resources/Channel.md
Outdated
|
||
- They cannot be edited. | ||
- Only a single audio attachment is allowed. No content, stickers, etc... | ||
- The attachment has additional fields: `duration_secs` and `waveform`. |
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.
- The attachment has additional fields: `duration_secs` and `waveform`. | |
- The [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) object has additional fields: `duration_secs` and `waveform`. |
probably not as bots cannot encounter that atm |
They can encounter it |
They can :-) |
Then the error code is incorrect. |
In order to ease the bikeshedding of error codes here:
|
it works with bots if you send btw |
| width? | ?integer | width of file (if image) | | ||
| ephemeral? \* | boolean | whether this attachment is ephemeral | | ||
| duration_secs? | float | the duration of the audio file (currently for voice messages) | | ||
| waveform? | string | base64 encoded bytearray representing a sampled waveform (currently for voice messages) | |
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.
Would it be worthwhile to document the exact format of this data? Apparently it's 8bit 10Hz
Is this a reversal of the previous reversal? This was brought up before with its removal but it was an unpopular decision (see #4427 and its subsequent reversal). |
No I'm just misaligned. I spoke with them and I'll sync the error codes for voice messages one time in this PR :P |
Thank you! |
see discord/discord-api-docs#6082 --------- Co-authored-by: Lukellmann <lukellmann@gmail.com>
* feat: voice message support Ref: discord/discord-api-docs#6082 * keep the waveform as-is While currently the docs specify it is a base64 byte array, it might be more worthwhile to give the API consumer a raw string and let them deal with it appropriately. Let alone this is probably a more future-proof variant, as (although very unlikely) the format could change in the future.
* feat: voice message support Ref: discord/discord-api-docs#6082 * keep the waveform as-is While currently the docs specify it is a base64 byte array, it might be more worthwhile to give the API consumer a raw string and let them deal with it appropriately. Let alone this is probably a more future-proof variant, as (although very unlikely) the format could change in the future.
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
* feat: voice message support Ref: discord/discord-api-docs#6082 * keep the waveform as-is While currently the docs specify it is a base64 byte array, it might be more worthwhile to give the API consumer a raw string and let them deal with it appropriately. Let alone this is probably a more future-proof variant, as (although very unlikely) the format could change in the future.
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
No breaking changes. Newly added: - `Attachment` fields: `duration_secs`, `waveform` - `MessageFlags` bitflag: `IS_VOICE_MESSAGE` - `model::Error` variant: `CannotEditVoiceMessage` - `Permissions` bitflag: `SEND_VOICE_MESSAGES` discord/discord-api-docs#6082
Summary
Voice messages has hit a form of general availability so it's time to bust out the API docs.
One thing to note is that even though voice messages are implemented as attachments, they do not require the Attach Files permission. The gating is purely on the Send Voice Message permission.
Bots are currently not able to send voice messages, mainly as a short-term implementation detail. This will change... eventually.
I wanted to document some implementation details about voice messages, but I'm not sure where to in the docs. So I just put there where I thought makes sense lol.
Also not sure if there's additional places that I should change 🤔