feat: add support for voice messages (#749)

Co-authored-by: advaith <advaithj1@gmail.com>
This commit is contained in:
MateoDeveloper
2023-04-21 03:33:12 -05:00
committed by GitHub
parent 0f7602605c
commit 3dac5b93e7
8 changed files with 52 additions and 6 deletions

View File

@@ -59,6 +59,7 @@ export const PermissionFlagsBits = {
* @unstable This permission flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
UseExternalSounds: 1n << 45n,
SendVoiceMessages: 1n << 46n,
} as const;
/**

View File

@@ -807,7 +807,7 @@ export enum MessageFlags {
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* This message is a voice message
*/
IsVoiceMessage = 1 << 13,
}
@@ -1321,6 +1321,14 @@ export interface APIAttachment {
* Whether this attachment is ephemeral
*/
ephemeral?: boolean;
/**
* The duration of the audio file (currently for voice messages)
*/
duration_secs?: number;
/**
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
}
/**

View File

@@ -793,7 +793,7 @@ export enum MessageFlags {
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* This message is a voice message
*/
IsVoiceMessage = 1 << 13,
}
@@ -1289,6 +1289,14 @@ export interface APIAttachment {
* Whether this attachment is ephemeral
*/
ephemeral?: boolean;
/**
* The duration of the audio file (currently for voice messages)
*/
duration_secs?: number;
/**
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
}
/**

View File

@@ -232,7 +232,13 @@ export enum RESTJSONErrorCodes {
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
UploadedFileNotFound,
CannotDeleteGuildSubscriptionIntegration = 50163,
VoiceMessagesDoNotSupportAdditionalContent = 50159,
VoiceMessagesMustHaveASingleAudioAttachment,
VoiceMessagesMustHaveSupportingMetadata,
VoiceMessagesCannotBeEdited,
CannotDeleteGuildSubscriptionIntegration,
YouCannotSendVoiceMessagesInThisChannel = 50173,
YouDoNotHavePermissionToSendThisSticker = 50600,

View File

@@ -59,6 +59,7 @@ export const PermissionFlagsBits = {
* @unstable This permission flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
UseExternalSounds: 1n << 45n,
SendVoiceMessages: 1n << 46n,
} as const;
/**

View File

@@ -807,7 +807,7 @@ export enum MessageFlags {
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* This message is a voice message
*/
IsVoiceMessage = 1 << 13,
}
@@ -1321,6 +1321,14 @@ export interface APIAttachment {
* Whether this attachment is ephemeral
*/
ephemeral?: boolean;
/**
* The duration of the audio file (currently for voice messages)
*/
duration_secs?: number;
/**
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
}
/**

View File

@@ -793,7 +793,7 @@ export enum MessageFlags {
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* This message is a voice message
*/
IsVoiceMessage = 1 << 13,
}
@@ -1289,6 +1289,14 @@ export interface APIAttachment {
* Whether this attachment is ephemeral
*/
ephemeral?: boolean;
/**
* The duration of the audio file (currently for voice messages)
*/
duration_secs?: number;
/**
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
}
/**

View File

@@ -232,7 +232,13 @@ export enum RESTJSONErrorCodes {
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
UploadedFileNotFound,
CannotDeleteGuildSubscriptionIntegration = 50163,
VoiceMessagesDoNotSupportAdditionalContent = 50159,
VoiceMessagesMustHaveASingleAudioAttachment,
VoiceMessagesMustHaveSupportingMetadata,
VoiceMessagesCannotBeEdited,
CannotDeleteGuildSubscriptionIntegration,
YouCannotSendVoiceMessagesInThisChannel = 50173,
YouDoNotHavePermissionToSendThisSticker = 50600,