fix: voice message

This commit is contained in:
Elysia 2023-05-26 23:38:54 +07:00
parent 07a737879e
commit b75688ee28
4 changed files with 19 additions and 3 deletions

View File

@ -20,7 +20,7 @@ class GuildForumThreadManager extends ThreadManager {
* @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions * @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
* @property {StickerResolvable} [stickers] The stickers to send with the message * @property {StickerResolvable} [stickers] The stickers to send with the message
* @property {BitFieldResolvable} [flags] The flags to send with the message. * @property {BitFieldResolvable} [flags] The flags to send with the message.
* Only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set. * Only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and `IS_VOICE_MESSAGE` can be set.
*/ */
/** /**
@ -82,6 +82,9 @@ class GuildForumThreadManager extends ThreadManager {
id: attachment.id, id: attachment.id,
filename: files[attachment.id].name, filename: files[attachment.id].name,
uploaded_filename: attachment.upload_filename, uploaded_filename: attachment.upload_filename,
description: files[attachment.id].description,
duration_secs: files[attachment.id].duration_secs,
waveform: files[attachment.id].waveform,
}; };
}); });
const attachmentsData = await Promise.all(requestPromises); const attachmentsData = await Promise.all(requestPromises);

View File

@ -143,6 +143,9 @@ class MessageManager extends CachedManager {
id: attachment.id, id: attachment.id,
filename: files[attachment.id].name, filename: files[attachment.id].name,
uploaded_filename: attachment.upload_filename, uploaded_filename: attachment.upload_filename,
description: files[attachment.id].description,
duration_secs: files[attachment.id].duration_secs,
waveform: files[attachment.id].waveform,
}; };
}); });
const attachmentsData = await Promise.all(requestPromises); const attachmentsData = await Promise.all(requestPromises);

View File

@ -318,7 +318,14 @@ class MessagePayload {
} }
const resource = await DataResolver.resolveFile(attachment); const resource = await DataResolver.resolveFile(attachment);
return { attachment, name, file: resource }; return {
attachment,
name,
file: resource,
description: fileLike.description,
duration_secs: fileLike.duration,
waveform: fileLike.waveform,
};
} }
/** /**

View File

@ -93,7 +93,7 @@ class TextBasedChannel {
* @property {ReplyOptions} [reply] The options for replying to a message * @property {ReplyOptions} [reply] The options for replying to a message
* @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message * @property {StickerResolvable[]} [stickers=[]] Stickers to send in the message
* @property {MessageFlags} [flags] Which flags to set for the message. * @property {MessageFlags} [flags] Which flags to set for the message.
* Only `SUPPRESS_EMBEDS` and `SUPPRESS_NOTIFICATIONS` can be set. * Only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and `IS_VOICE_MESSAGE` can be set.
*/ */
/** /**
@ -187,6 +187,9 @@ class TextBasedChannel {
id: attachment.id, id: attachment.id,
filename: files[attachment.id].name, filename: files[attachment.id].name,
uploaded_filename: attachment.upload_filename, uploaded_filename: attachment.upload_filename,
description: files[attachment.id].description,
duration_secs: files[attachment.id].duration_secs,
waveform: files[attachment.id].waveform,
}; };
}); });
const attachmentsData = await Promise.all(requestPromises); const attachmentsData = await Promise.all(requestPromises);