diff --git a/index.d.ts b/index.d.ts index 74b0dc0e..8cdb5c2d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2225,6 +2225,7 @@ declare namespace Dysnomia { LOADING: 128; FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 256; SUPPRESS_NOTIFICATIONS: 4096; + IS_VOICE_MESSAGE: 8192; }; MessageTypes: { DEFAULT: 0; @@ -2328,10 +2329,11 @@ declare namespace Dysnomia { moderateMembers: 1099511627776n; viewCreatorMonetizationAnalytics: 2199023255552n; useSoundboard: 4398046511104n; + sendVoiceMessages: 70368744177664n; allGuild: 3309205717182n; - allText: 535529258065n; + allText: 70904273435729n; allVoice: 4952431789841n; - all: 8796093022207n; + all: 79164837199871n; }; PremiumTiers: { NONE: 0; @@ -2534,6 +2536,7 @@ declare namespace Dysnomia { export class Attachment extends Base { contentType?: string; description?: string; + durationSecs?: number; ephemeral?: boolean; filename: string; height?: number; @@ -2541,6 +2544,7 @@ declare namespace Dysnomia { proxyURL: string; size: number; url: string; + waveform?: string; width?: number; constructor(data: BaseData); } diff --git a/lib/Constants.js b/lib/Constants.js index 0ea7d2bb..44af7496 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -406,7 +406,8 @@ module.exports.MessageFlags = { EPHEMERAL: 1 << 6, LOADING: 1 << 7, FAILED_TO_MENTION_SOME_ROLES_IN_THREAD: 1 << 8, - SUPPRESS_NOTIFICATIONS: 1 << 12 + SUPPRESS_NOTIFICATIONS: 1 << 12, + IS_VOICE_MESSAGE: 1 << 13 }; module.exports.MessageTypes = { @@ -502,7 +503,8 @@ const Permissions = { startEmbeddedActivities: 1n << 39n, moderateMembers: 1n << 40n, viewCreatorMonetizationAnalytics: 1n << 41n, - useSoundboard: 1n << 42n + useSoundboard: 1n << 42n, + sendVoiceMessages: 1n << 46n }; Permissions.allGuild = Permissions.kickMembers | Permissions.banMembers @@ -538,7 +540,8 @@ Permissions.allText = Permissions.createInstantInvite | Permissions.createPublicThreads | Permissions.createPrivateThreads | Permissions.useExternalStickers - | Permissions.sendMessagesInThreads; + | Permissions.sendMessagesInThreads + | Permissions.sendVoiceMessages; Permissions.allVoice = Permissions.createInstantInvite | Permissions.manageChannels | Permissions.voicePrioritySpeaker diff --git a/lib/structures/Attachment.js b/lib/structures/Attachment.js index bd550d83..5fda4e02 100644 --- a/lib/structures/Attachment.js +++ b/lib/structures/Attachment.js @@ -6,6 +6,7 @@ const Base = require("./Base"); * Represents an attachment * @prop {String?} contentType The content type of the attachment * @prop {String?} description The description of the attachment + * @prop {Number?} durationSecs The duration of the audio file (voice messages only) * @prop {Boolean?} ephemeral Whether the attachment is ephemeral * @prop {String} filename The filename of the attachment * @prop {Number?} height The height of the attachment @@ -13,6 +14,7 @@ const Base = require("./Base"); * @prop {String} proxyURL The proxy URL of the attachment * @prop {Number} size The size of the attachment * @prop {String} url The URL of the attachment + * @prop {String?} waveform A Base64-encoded byte array representing the sampled waveform of the audio file (voice messages only) * @prop {Number?} width The width of the attachment */ class Attachment extends Base { @@ -23,6 +25,8 @@ class Attachment extends Base { this.size = data.size; this.url = data.url; this.proxyURL = data.proxy_url; + this.durationSecs = data.duration_secs; + this.waveform = data.waveform; this.update(data); } @@ -55,6 +59,8 @@ class Attachment extends Base { "height", "width", "ephemeral", + "durationSecs", + "waveform", ...props ]); }