From 63c0dedc4e47b016dc32f86f46cd60fb4be75194 Mon Sep 17 00:00:00 2001 From: idanran <96647698+idanran@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:01:47 +0000 Subject: [PATCH] Update message.ts --- adapters/discord/src/message.ts | 4 ++-- adapters/discord/src/types/message.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/adapters/discord/src/message.ts b/adapters/discord/src/message.ts index c9f64875..c030d822 100644 --- a/adapters/discord/src/message.ts +++ b/adapters/discord/src/message.ts @@ -305,11 +305,11 @@ export class DiscordMessageEncoder extends MessageE attachments: [ { waveform: '', // base64 encoded bytearray representing a sampled waveform - id: '0', + id: 0, duration_secs: attrs.duration ?? 0, }, ], - flags: 1 << 13, // https://discord.com/developers/docs/resources/channel#message-object-message-flags + flags: Message.Flag.IS_VOICE_MESSAGE, }) this.buffer = '' } else if (type === 'author') { diff --git a/adapters/discord/src/types/message.ts b/adapters/discord/src/types/message.ts index 56789f7b..676bb755 100644 --- a/adapters/discord/src/types/message.ts +++ b/adapters/discord/src/types/message.ts @@ -134,6 +134,10 @@ export namespace Message { LOADING = 1 << 7, /** this message failed to mention some roles and add their members to the thread */ FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8, + /** this message will not trigger push and desktop notifications */ + SUPPRESS_NOTIFICATIONS = 1 << 12, + /** this message is a voice message */ + IS_VOICE_MESSAGE = 1 << 13, } /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */